Skip to content

test(server): stopped-queue steering test no longer races queue promotion - #22529

Open
tris203 wants to merge 1 commit into
pingdotgg:mainfrom
tris203:chore/flake-steering-stopped-queue
Open

tris203 wants to merge 1 commit into
pingdotgg:mainfrom
tris203:chore/flake-steering-stopped-queue

Conversation

@tris203

@tris203 tris203 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Problem

SteeringCompletion.integration.test.ts › "queues a plain send behind the stopped queue and releases its hold" can fail with queued texts ['sent'] instead of ['queued', 'sent'] (item 7 of #22324).

During worker.drain(), the fake provider's interruptTurn returns immediately, so the stop settles and the stopped run becomes interrupted. A detached reactor on run.updated (Orchestrator.ts handleRunUpdate) then promotes the unheld queued run to starting on its own fiber, outside drain. The test reads the projection right after drain, so whichever fiber runs first decides the result. It reproduces on upstream main: making the test wait for that promotion before its read produces the CI failure exactly (queued is starting, started.length is still 1).

Change

Test-only. The harness's fake interruptTurn now takes an optional effect, which defaults to Effect.void, so the other tests are unchanged. This test passes one that signals a Deferred when the provider is asked to stop and then waits to be released. The test forks drain, waits for that signal, and checks the queue while the provider is still stopping. It then releases the stop, joins drain, and checks that nothing was steered.

Scope and approval

Item 7 of #22324. @juliusmarminge invited picking up the remaining #22324 flakes in #22511 (comment). One test, no product code.

Verification

  • Made the unchanged test wait for the reactor's promotion before reading the queue: it fails with expected [ 'sent' ] to deeply equal [ 'queued', 'sent' ], the CI failure.
  • With the fix, made the test wait for the same promotion after releasing the stop: it passed 3 of 3 runs.
  • vp test run apps/server/src/orchestration-v2/SteeringCompletion.integration.test.ts: 17/17 pass.

Investigated and written by Claude Opus 5.5 in Claude Code (T3 Code), reviewed by GPT-6.1-Sol in Codex.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 20, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at eb6a9c7

Macroscope's review found this PR approvable — This PR only adjusts an ignored integration-test harness and test timing to eliminate a queue-promotion race; it does not affect production behavior, product defaults, or static-analysis configuration.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dcd35f53-dad5-4361-bcae-26238a787871
📥 Commits

Reviewing files that changed from the base of the PR and between 5bcc90e and eb6a9c7.

📒 Files selected for processing: 1
  • apps/server/src/orchestration-v2/SteeringCompletion.integration.test.ts

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

📝 Walkthrough

The integration test harness now accepts an injectable interrupt effect. The plain-send-after-stop test checks queued messages while interruption is pending, then releases the interruption and verifies the worker drain completes without steering.

Changes: Steering completion test

Layer / File(s) Summary
Inject and delay interruption
apps/server/src/orchestration-v2/SteeringCompletion.integration.test.ts
The harness passes an optional interrupt effect to the provider adapter. The test delays interruption to inspect the queue, then releases it, waits for the worker to drain, and verifies that no steering occurred.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Suggested reviewers: lbgos

Merge Risk: ⚪ Minimal · up to eb6a9

The test timing is correctly synchronized and introduces no identified merge-blocking risk.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly identifies the test-only fix for the stopped-queue steering race and follows the repository's conventional commit style.
Description check Passed The description includes complete Problem, Change, Scope and approval, and Verification sections. It states the failure, explains the fix, links the tracked issue and approval, and reports focused tes…
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.
Full details: Description check

Explanation

The description includes complete Problem, Change, Scope and approval, and Verification sections. It states the failure, explains the fix, links the tracked issue and approval, and reports focused test results.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

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

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant