-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
xunit v3 preparation #2723
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
xunit v3 preparation #2723
Conversation
Cherry-pick changes from #2440 to prepare to switch to xunit v3.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2723 +/- ##
=======================================
Coverage 96.12% 96.12%
=======================================
Files 309 309
Lines 7118 7118
Branches 1008 1008
=======================================
Hits 6842 6842
Misses 222 222
Partials 54 54
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
- Exclude helper from coverage. - Update incorrect comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR prepares the codebase for xunit v3 by introducing a shared TestCancellation utility and standardizing test cancellation token usage across the entire test suite. The changes improve test consistency and prepare for potential future xunit compatibility requirements.
Key changes:
- Addition of
TestCancellation.Tokenhelper to centralize test cancellation token management - Systematic replacement of
CancellationToken.NonewithTestCancellation.Tokenin all test files - Addition of thread-safe semaphore release logic in production code to prevent ObjectDisposedException
Reviewed Changes
Copilot reviewed 128 out of 128 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/Shared/TestCancellation.cs | New shared utility providing centralized test cancellation token |
| Multiple test project .csproj files | Added references to shared TestCancellation utility |
| 100+ test files | Replaced CancellationToken.None with TestCancellation.Token throughout |
| src/Polly/Bulkhead/BulkheadEngine.cs | Added safe semaphore release to prevent ObjectDisposedException |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Cherry-pick changes from #2440 to prepare to switch to xunit v3.