Skip to content

test(daemon): await cancellation before advancing the queue clock - #1883

Open
bheemreddy-samsara wants to merge 1 commit into
callstackincubator:mainfrom
bheemreddy-samsara:bheemreddy-samsara/fix-cancellation-test-race
Open

bheemreddy-samsara wants to merge 1 commit into
callstackincubator:mainfrom
bheemreddy-samsara:bheemreddy-samsara/fix-cancellation-test-race

Conversation

@bheemreddy-samsara

@bheemreddy-samsara bheemreddy-samsara commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Related: #1808, where the Windows cancellation-test race was observed.

The Windows cancellation test could advance the fake queue clock after admission but before cancellation was processed, producing QUEUE_TIMEOUT instead of CANCELLED (failing run). Wait for the aborted request to settle before advancing the clock. The existing cancellation and rejection-event assertions remain intact.

Validation

Head: aea9098e25ec409030d2ee71efe5a1444a619a8b.

  • All 26 tests in src/daemon/server-roles.test.ts pass locally.
  • Typecheck and git diff --check pass.
  • Windows validation is pending CI.

Workflow: Not applicable — test synchronization only; production behavior is unchanged.

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 0 blocking, 0 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Assessment: complete
Rounds: 1. Tokens: n/a.
Notes: Independent review approved the full diff with no findings.

Wait for the aborted lease request to settle before advancing its fake queue deadline. Queue admission alone does not mean the cancellation frame has been processed, which let the timeout win on Windows.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The abort-related lease test now waits for the request promise to settle before advancing the clock. Queue admission no longer ends the wait.

Suggested reviewers: v3ron

Merge Risk: Minimal · up to aea90

This change only makes a cancellation test wait for the aborted request to settle before advancing the fake clock, which removes a Windows timing flake. Production behavior is unchanged, so merge risk is minimal. The PR body check needs its final line updated to the required agent footer.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the test change that the diff makes: the test now awaits cancellation before advancing the queue clock. It matches the single-line change in src/daemon/server-roles.test.ts. It follows…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description states the change: it waits for the aborted request to settle before advancing the fake queue clock in the Windows cancellation test. It cites the related issue #1808 and the failing C…
Full details: Title check

Explanation

The title names the test change that the diff makes: the test now awaits cancellation before advancing the queue clock. It matches the single-line change in src/daemon/server-roles.test.ts. It follows the conventional prefix style and is specific enough for a reader scanning history.

Full details: Description check

Explanation

The description states the change: it waits for the aborted request to settle before advancing the fake queue clock in the Windows cancellation test. It cites the related issue #1808 and the failing CI run, and it lists local test and typecheck results. The raw summary matches this: one test in src/daemon/server-roles.test.ts changed from waiting for queueDepth === 1 to waiting for the request promise to settle. The description is related to the changeset and is specific, so it passes.

Finishing Touches

Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: de395ef5-93e2-48b4-bc7e-98d7e9fefa8b
Commits

Reviewing files that changed from the base of the PR and between 9021bd9 and aea9098.

Files selected for processing: 1

  • src/daemon/server-roles.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant