Repository navigation
Make cancellation test independent of request timeout - #198
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove the cancellation test's dependency on the request timeout. A stalled CI runner can let the deadline win before the test cancels the request; the injected sleep now exits without producing a timeout.
Closes #134
How checked
swift build && swift test --filter HIDPPTests(76 tests passed)swift test --filter cancellationFailsImmediately(passed)swift test --skip-build --filter cancellationFailsImmediately: 200/200 sequential runs and 100/100 across four concurrent loops.Footprint
Test-only change.
Docs
No behavior or durable documentation changes.
Agent evidence
The original test's 10-second request timeout could expire during a runner stall; main had already raised it to an hour. The cancellation handler hops to the main actor, where the continuation is stored synchronously before the actor can execute that hop. Request tokens are unique and the queued caller is checked for cancellation on handoff. The test now uses the existing sleep seam to make the deadline task exit without timing out; the cancellation and queued response remain exercised.
failsSilenceAtOnceinstead makes silence time out immediately and is unsuitable here.The filtered stress runs passed 200/200 sequentially and 25/25 in each of four concurrent loops.
git diff --checkpassed. Local Swift is 6.4.2; CI covers Swift 6.3.