Repository navigation
test: stabilize flaky fixtures (batch f021) - #167301
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. Reviewed October 8, 2026, 11:38 AM ET / 15:38 UTC. ClawSweeper reviewWhat this changesThis PR preloads the session-creation handler and isolates graceful-shutdown fixture waits from runner timing and test cancellation. Review scores
ProductKind: Test only · Worth it: Yes Merge readiness⛔ Needs changes before merge - 1 item remains No actionable patch defect found. This useful fixture repair remains distinct from current main, but the reported single passing run does not meet the repository’s stabilization-validation guidance. Priority: P3 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway receives agent requests and retains execution ownership until commands and cleanup finish. These fixtures check that stopping or restarting the Gateway releases its dependencies only after that work settles. flowchart TD
A[Shutdown fixture setup] --> B[Prepare session handler]
B --> C[Create child session through Gateway]
C --> D[Admit controlled agent work]
D --> E{Shutdown mode}
E --> F[Stop or restart cancellation]
E --> G[Graceful completion with controlled clock]
F --> H[Verify cleanup and dependency release order]
G --> H
Technical reviewBest possible solution: Keep the existing lifecycle fixture and production owners, using scoped clock control and cancellation-aware waits to remove fixture timing noise. Do we have a high-confidence way to reproduce the issue? No high-confidence failing run was established in this read-only review. Source supports the timing mechanism, while the supplied evidence shows only an after-change passing run. Is this the best way to solve the issue? Yes, the fixture-level approach is appropriately narrow: it preserves real cleanup and polling while moving lazy preparation outside the RPC budget. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 73fb34cfcf81. Provenance checked
TestingProof path: in-process harness. Added test files: 1. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +12. Total +12 across 1 file. View PR surface stats
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 |
What Problem This Solves
Gateway shutdown fixtures can spend their RPC budget loading the lazy session handler, or exhaust the graceful-drain budget while the test runner is busy.
User Impact
No user-visible behavior changes. This stabilizes the existing stop, restart, and graceful-shutdown lifecycle proof while retaining its cleanup, cancellation, finalizer ordering, and owner-release assertions.
Why This Change Was Made
Prepare the lazy
sessions.createhandler during suite setup. During the graceful row, freeze onlyDate, preserving real polling and cleanup, and bind pending fixture waits to the test cancellation signal. The existing time budgets and production code remain unchanged.Batch f021 was replayed onto
ea7cc1066568fbbeece9151c497ecab15923bd2a. Applied333e99139f14a142abc517418ce6bbf00ad29cf4without conflicts. The other seven commits were skipped after checking current source andgit log -Sbecause their fixes are already on main:85d20724130fc6168a9597e8(#166060), refined by623d8e02a5d8(#166236)44f8af9c51e6c6168a9597e8(#166060)7cae9efe5179eea001248e7f(#166199)96432ad8710ba2e44be9f830(#166317)6c1fc4ff609c3a085ea5dee4(#165837)0befc52261e9699a3c58bf28(#166259)791fae409b44623d8e02a5d8(#166236)No conflict-resolution hunks were dropped or rewritten. Diff: production +0/-0, tests +25/-13 in one file. No changed path matches the current CODEOWNERS rules.
Evidence
node_modules/.bin/oxfmt --write src/gateway/server.agent-execution-shutdown.test.tspassed without changing the replayed diff.node_modules/.bin/oxlint -c .oxlintrc.json src/gateway/server.agent-execution-shutdown.test.tsexited 0.git diff --check origin/mainpassed; changed-check dry-run selected the core-test lane.CI=1 pnpm install --frozen-lockfile --prefer-offline >/dev/null && CI=1 pnpm test src/gateway/server.agent-execution-shutdown.test.tspassed 3/3 tests (one file; 88.09s test-command wall time, 85.53s Vitest duration) on Linux/Node 24.19.0. The wrapper verified source3b011a80263419c1a2622ff36737a24f6da7e74fand treeeb866e0566f9c63e6dac1721321938b3b231ad47. Leasetbx_01m4e1009e46nvyggh5qhc89kz, allocation run.OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- src/gateway/server.agent-execution-shutdown.test.tspassed on Blacksmith Testbox, including Gateway-server types, all three dead-export scans, policy ratchets, formatting, and targeted lint (0 warnings/errors). Leasetbx_01m4e1drennbmg2dwh6gm3g8jq, allocation run. Both leases are stopped; allocation-run cancellation during lease cleanup is not a test failure.openclaw/ci-gateremains the merge gate.