Repository navigation
fix(test): keep queued Stop cleanup on real timers - #197734
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@clawsweeper re-review Final head ac8a7ba removes the fake-clock-only source spy/barrier and waits for the existing real cleanup deadline. Controlled real-admission red/green proof, clean final focused test, full required changed checks, and independent Codex review are complete. The original hosted interleaving remains explicitly untraced; all public and durable-state assertions remain. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesRemoves global fake timers and their settlement spy from the queued-subagent Stop product test. Example: Stop a yielded child while release of queued input custody is held.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR is a focused, useful fixture repair with no actionable correctness or security findings; exact-head CI is still running. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway product fixture drives real subagent spawning, yielding, ingress custody, and public Stop requests against a synthetic model server, then checks persisted cancellation and teardown. flowchart LR
A[Synthetic model server] --> B[Gateway agent runner]
B --> C[Yielded child]
D[Queued ingress input] --> C
E[Public Stop request] --> F[Session controller cleanup]
C --> F
F --> G[HTTP result and durable cancellation]
Technical reviewBest possible solution: Keep this minimal fixture repair, preserving the production cleanup deadline and all observable lifecycle assertions. Do we have a high-confidence way to reproduce the issue? Source confirms the circular fixture dependency between frozen timer-driven admission release and the later clock-advance barrier; the author reports a controlled reproduction, while the exact hosted interleaving remains unknown and no tests were run during this review. Is this the best way to solve the issue? Removing the global fake clock fixes the fixture-owned cause with the existing cleanup owners and preserves every public and durable-state assertion. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cee928335feb. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceTests -27. Total -27 across 1 file. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 12, 2026, 7:51 AM ET / 12:51 UTC. |
|
Merged via squash.
|
…plugin-reload-runtime-20261112 * commit '5d6a026e43757ea6302e4c1151d6ace28468ced0': fix(logging): avoid main-thread stalls when resolving default log files (#197742) fix(sessions): commit selected invitations with original messages (#184512) improve: make Telegram tool progress easier to scan (#197523) fix(test): keep queued Stop cleanup on real timers (#197734) fix: keep usage pricing from blocking the Gateway on filesystem lookups (#197599)
What Problem This Solves
Fixes a queued-input Stop product fixture that can deadlock its own admission cleanup before reaching its clock-advance barrier.
User Impact
Test-only repair: production behavior and deadlines are unchanged. Public Stop still returns 503 while cleanup is held, and a retry returns 200 with
killed: falseafter cleanup settles. Durable cancellation, input custody, no-dispatch, and teardown assertions remain.Why This Change Was Made
The fixture froze global setTimeout before public Stop, then waited for source settlement before advancing time. Stop can first drain an admission whose producer releases asynchronously; freezing that release prevents the test from reaching its own barrier. Restoring real timers after the 503 assertion (#197621) cannot repair an earlier wait.
Remove the fake clock and its source-settlement spy/barrier, and wait for the existing 15-second cleanup deadline. The final test shrinks by 27 net lines; no production code, configuration, or timeout changes.
Evidence
Original repeat failure: https://github.com/openclaw/openclaw/actions/runs/43204708317/job/131137467166. The final clean uninstrumented case passes in 26.153s (88.67s total, including 39.901s worker compilation); independent Codex review through P2 is clean. Required
pnpm check:changed --base c06331c4b8e6f7be8ed947a43c5ab9701961fd16passes, including format, ratchets, gateway-server test types, all dead-export scans, and focused lint.