Skip to content

Make cancellation test independent of request timeout - #198

Merged
mblauberg merged 1 commit into
mainfrom
lane/flaky-134
Nov 4, 2026
Merged

mblauberg merged 1 commit into
mainfrom
lane/flaky-134

Conversation

@mblauberg

Copy link
Copy Markdown
Owner

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)
  • Repeated swift test --skip-build --filter cancellationFailsImmediately: 200/200 sequential runs and 100/100 across four concurrent loops.
  • No live mouse or daemon used.

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. failsSilenceAtOnce instead 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 --check passed. Local Swift is 6.4.2; CI covers Swift 6.3.

@mblauberg mblauberg added the bug Something isn't working label Nov 4, 2026
@mblauberg
mblauberg merged commit 63b7b9c into main Nov 4, 2026
2 checks passed
@mblauberg
mblauberg deleted the lane/flaky-134 branch November 4, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky: a cancelled HIDPP request sometimes waits for its timeout

1 participant