-
-
Notifications
You must be signed in to change notification settings - Fork 84
feat: enhance test filtering to handle explicit tests #2766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Claude finished @thomhurst's task —— View job Code Review Complete ✅I've completed a thorough review of PR #2766: "feat: enhance test filtering to handle explicit tests". Here's my comprehensive feedback: Todo List:
Overall Assessment: ✅ Excellent ImplementationThis PR implements a well-thought-out solution for handling explicit tests in the TUnit framework with sophisticated filtering logic and comprehensive test coverage. 🎯 StrengthsCode Quality & Design
Robust Logic Implementation
Comprehensive Test SuiteThe new test files provide excellent coverage:
📋 Code Quality ObservationsPerformance ⚡
Security 🔒
Maintainability 🔧
🔍 Minor SuggestionsDocumentation EnhancementConsider adding XML documentation to the main filtering method: /// <summary>
/// Filters tests based on the provided filter, with special handling for explicit tests.
/// When both explicit and non-explicit tests match a filter, explicit tests are excluded.
/// When only explicit tests match a filter, they are included.
/// </summary>
public IReadOnlyCollection<AbstractExecutableTest> FilterTests(...) Code RobustnessThe 🧪 Test Coverage AssessmentExcellent Coverage
Test Quality
📁 File Changes ReviewF# Project File (
|
Claude finished @thomhurst's task —— View job PR Code Review - "feat: enhance test filtering to handle explicit tests"Todo List:
Overall Assessment: ✅ Excellent ImplementationThis PR implements a well-thought-out solution for handling explicit tests in the TUnit framework with sophisticated filtering logic and comprehensive test coverage. 🎯 StrengthsCode Quality & Design
Robust Logic Implementation
Comprehensive Test SuiteThe new test files provide excellent coverage:
📋 Code Quality ObservationsPerformance ⚡
Security 🔒
Maintainability 🔧
🔍 Minor SuggestionsDocumentation EnhancementConsider adding XML documentation to the main filtering method: /// <summary>
/// Filters tests based on the provided filter, with special handling for explicit tests.
/// When both explicit and non-explicit tests match a filter, explicit tests are excluded.
/// When only explicit tests match a filter, they are included.
/// </summary>
public IReadOnlyCollection<AbstractExecutableTest> FilterTests(...) Code RobustnessThe 🧪 Test Coverage AssessmentExcellent Coverage
Test Quality
📁 File Changes ReviewF# Project File (
|
Claude finished @thomhurst's task —— View job PR Code Review - "feat: enhance test filtering to handle explicit tests"Todo List:
Overall Assessment: ✅ Excellent ImplementationThis PR implements a well-thought-out solution for handling explicit tests in the TUnit framework with sophisticated filtering logic and comprehensive test coverage. 🎯 StrengthsCode Quality & Design
Robust Logic Implementation
Comprehensive Test SuiteThe new test files provide excellent coverage:
📋 Code Quality ObservationsPerformance ⚡
Security 🔒
Maintainability 🔧
🔍 Minor SuggestionsDocumentation EnhancementConsider adding XML documentation to the main filtering method: /// <summary>
/// Filters tests based on the provided filter, with special handling for explicit tests.
/// When both explicit and non-explicit tests match a filter, explicit tests are excluded.
/// When only explicit tests match a filter, they are included.
/// </summary>
public IReadOnlyCollection<AbstractExecutableTest> FilterTests(...) Code RobustnessThe 🧪 Test Coverage AssessmentExcellent Coverage
Test Quality
📁 File Changes ReviewF# Project File (
|
Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
These methods were never called and represent dead code. The timeout attribute is captured in the generated code but the 30-minute default is never overridden (that's a separate issue). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Added 5-second timeout for each OnDispose event handler - Prevents tests from hanging indefinitely if disposal logic deadlocks - Logs warnings when disposal times out, errors are logged but don't fail the test - This ensures robust cleanup even when disposal handlers misbehave 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: thomhurst <30480171+thomhurst@users.noreply.github.com>
This resolves the hanging issue reported in #2867 by removing the await ReleaseObject(obj) calls from OnDispose event handlers. The root cause was that multiple disposal handlers could simultaneously attempt to dispose the same shared object (like WebApplicationFactory with SharedType.PerTestSession), causing deadlocks in complex disposable objects. Changes: - OnDispose handlers now only decrement reference counts - Shared objects are disposed by their natural lifecycle management - Prevents hanging while maintaining proper reference tracking - No resource leaks as objects are still properly disposed by their scopes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Tom Longhurst <undefined@users.noreply.github.com>
- Restore ReleaseObject() calls in OnDispose handlers to actually dispose objects - Objects are only disposed when reference count reaches zero (proper sharing) - Add 5-second timeout protection to prevent hanging during disposal - Separate DisposeObjectAsync() method for cleaner disposal logic - Maintain duplicate handler prevention using _registeredHandlers - Support both IAsyncDisposable and IDisposable objects - Exception handling prevents disposal failures from hanging tests This provides a generic and maintainable counting/tracking approach that properly disposes shared objects while preventing race conditions. Co-authored-by: Tom Longhurst <thomhurst@users.noreply.github.com>
@claude fix this |
Claude finished @thomhurst's task —— View job Fix Complete ✅Todo List:
Issue Identified:The CI was failing because the TUnit.Engine.Tests were timing out (20 minutes) and hanging with exit code 7. The root cause was in the Fix Applied:Enhanced the
Changes Made:
The fix has been committed and pushed to the Commit: |
Prevent ObjectTracker from disposing shared objects when individual test contexts complete. Shared objects should only be disposed when their respective lifecycle scope ends (PerClass, PerAssembly, PerTestSession). This fixes the issue where DataClass objects were being disposed prematurely, causing ObjectDisposedException when test classes tried to access them during their disposal phase. Co-authored-by: Tom Longhurst <thomhurst@users.noreply.github.com>
…butes Improve the IsExplicitTest method in TestFilterService to more reliably detect ExplicitAttribute at both method and class levels. This resolves test filtering issues that were causing tests to hang during execution. - First check the aggregated TestDetails.Attributes collection - Add fallback reflection check on the class type directly - Fixes timeout issues with Engine.Tests by ensuring proper explicit test filtering 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Tom Longhurst <thomhurst@users.noreply.github.com>
Fixes #2755