fix: flaky Cancellation_Observed test — use pre-cancelled token#147
fix: flaky Cancellation_Observed test — use pre-cancelled token#147JerrettDavis merged 2 commits intomainfrom
Conversation
The test was racing: 10ms CancellationTokenSource timeout vs 100ms delay. On fast CI runners the operation could complete before cancellation fired. Fix: pre-cancel the token so cancellation is immediate and deterministic. Use a long delay (5000ms) so the operation would never complete without cancellation, making the test reliable regardless of runner speed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
Test Results417 tests 417 ✅ 1m 45s ⏱️ Results for commit 2acad85. ♻️ This comment has been updated with latest results. |
🔍 PR Validation ResultsVersion: `` ✅ Validation Steps
📊 ArtifactsDry-run artifacts have been uploaded and will be available for 7 days. This comment was automatically generated by the PR validation workflow. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #147 +/- ##
==========================================
+ Coverage 81.15% 86.03% +4.87%
==========================================
Files 196 196
Lines 19134 19134
Branches 2712 2712
==========================================
+ Hits 15529 16462 +933
+ Misses 2879 2672 -207
+ Partials 726 0 -726
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Mixed_Sync_And_Async_Handlers_Both_Invoked was using task.Wait() with no timeout, which could deadlock on CI runners under load. Added explicit 30s timeout with clear error message. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
116aa06 to
2acad85
Compare
Code Coverage |
Summary
Fix flaky
AsyncTemplateMethodTests.Cancellation_Observedtest that fails on net9.0 CI runners.Root cause: 10ms
CancellationTokenSourcetimeout vs 100ms delay — race condition where the operation could complete before cancellation fired.Fix: Pre-cancel the token so cancellation is immediate and deterministic. Use 5000ms delay to ensure the operation would never complete without cancellation.
Test plan
🤖 Generated with Claude Code