Repository navigation
refactor(queue): reuse shared deferred fixtures - #137338
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 10:08 AM ET / 14:08 UTC. ClawSweeper reviewWhat this changesThe branch replaces local deferred-promise test fixtures in the bounded queue and voice-transcript tests with the existing shared helper. Merge readiness✅ Ready for maintainer review Keep this PR open for normal maintainer merge handling. The focused test-only refactor is correct, current main still contains both local fixtures, and the protected Priority: P3 Review scores
Verification
How this fits togetherThese tests hold asynchronous queue work behind deferred promises, then release it to verify FIFO ordering, overflow behavior, drain barriers, and voice-transcript cleanup. The production queue and transcript registry consume that asynchronous work; this PR changes only how the tests control it. flowchart LR
A[Test case] --> B[Shared deferred helper]
B --> C[Queue or transcript registry]
C --> D[Asynchronous operation]
D --> E[Ordering and cleanup assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -20. Total -20 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one shared deferred fixture for these tests and merge the refactor once ordinary exact-head CI completes. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR is a behavior-neutral test-fixture consolidation, not a report of a runtime defect. Is this the best way to solve the issue? Yes. Both removed fixtures only provide deferred promise controls already supplied by the canonical helper, which is already used by the neighboring store-writer queue test and many other tests. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2d17bbaf88a8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* refs/remotes/origin/main: fix(plugins): reject unverifiable pinned npm installs (#136725) improve(ui): lift sidebar section headers on hover and mark online owners (#136985) test(cron): reuse isolated run suite hooks (#137341) test(channels): reuse shared indexed call guards (#137350) fix(ui): sidebar header controls read misaligned after the + button lost its border (#137317) fix(qa-channel): preserve conversation kind for implicit actions (#137343) fix: target the source checkout in Control UI repair commands (#137354) chore: reduce CI job count and database test overhead (#137352) fix(ios): preserve chat live edge across keyboard transitions (#136660) refactor(control-ui): consolidate mention inbox requests (#137375) fix(openai): preserve ChatGPT HTTP status for retry pacing (#137146) fix(mcp): hide policy-denied plugin tools from ACP sessions [AI] (#136546) test(queue): reuse shared deferred fixtures (#137338) fix(gateway): repair the Gateway E2E shard (browser suite project, skill resource argv, Codex diagnostic) (#137358)
What Problem This Solves
The bounded serial queue and voice transcript registry tests each maintained a local deferred-promise factory despite an existing shared test helper used by the neighboring store-writer queue suite.
Why This Change Was Made
Replace both local factories with
createDeferredfromtest/helpers/promise. All seven target cases and 32 assertions remain, with only the factory calls renamed inside their bodies. FIFO ordering, failure barriers, count/weight limits, accepted-prefix flushing, idempotent sealing, and terminal overflow through drain and close/reopen keep their existing checks.User Impact
No user-visible behavior change. Production delta is zero; tests are +9/−29, net −20 lines. Runtime queues, registry ownership, shared helpers, and public interfaces are unchanged.
Evidence
The same canonical five-suite selection passed all 24 cases before and after, with identical per-file order: bounded queue (6), voice registry (1), store-writer queue (3), request-start (6), and Talk Gateway control (8). Proof used Node 26.8.1, pnpm 12.1.0, and Vitest 4.1.11.
After the normal frozen install, the first unchanged baseline failed before collection with a Vitest cache
ENOENT; zero tests ran. The installed cache owner was inspected, all children were joined, and the same canonical selection with--clearCachesucceeded. The unchanged baseline retry then passed. The failed attempt remains recorded; no manual cache removal, cache override, source workaround, or timeout increase was used.node scripts/check-changed.mjs -- src/shared/bounded-serial-queue.test.ts src/talk/voice-transcript.test.tspassed the full configured local gate, including test typechecking, lint, and export checks. Formatting preserved the reviewed bytes. Managed Codex review was clean through P2. This is helper consolidation, not new lifecycle coverage; the existing synchronous overflow case's unjoined release remains unchanged. Hosted CI will be checked on the published head.