Repository navigation
fix(gateway): isolate placement tests after cancellation - #149668
Conversation
Keep teardown inside the original 90-second body deadline and join it before the next case acquires shared state. Preserve the fixture scenarios and assertions introduced by obviyus in #147390. Add a source-bound cancellation regression, forward context-local expect, and use the existing typed deferred owner.
|
🦞👀 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 maintainer review before merge. Reviewed September 16, 2026, 12:13 AM ET / 04:13 UTC. ClawSweeper reviewWhat this changesThe PR prevents canceled Gateway placement tests from overlapping shared state, adds a controlled cancellation regression, and routes that regression into isolated test execution. Merge readiness✅ Ready for maintainer review Keep open: this is a focused fixture-isolation repair that current main still needs. No blocking correctness or security finding was identified; the maintainer-authored prerequisite remains distinct from the linked worktree feature. Priority: P2 Review scores
Verification
How this fits togetherGateway placement tests verify recovery from offline devices, subsequent chat turns, and transcript archival. Their fixtures own a Gateway, provider subprocess, temporary state, and module spies that must finish cleanup before another case starts. flowchart TD
A[Placement recovery cases] --> B[Fixture admission guard]
B --> C[Gateway and provider startup]
C --> D[Recovery and chat assertions]
E[Test cancellation] --> F[Join body and ordered cleanup]
D --> F
F --> G[Release shared state]
G --> B
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +340. Total +340 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the existing recovery scenarios while giving their shared resources one cancellation-aware lifetime that releases state only after verified teardown. Do we have a high-confidence way to reproduce the issue? Yes, from source: cancel the registered case during pending startup and attempt another acquisition before cleanup settles. The new regression models that sequence; this review did not execute it. Is this the best way to solve the issue? Yes. The patch reuses the existing lifetime and ordered-cleanup helpers, preserves the original recovery assertions, and keeps the fix within test infrastructure. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against baa836b031a2. 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.
|
…49668) Keep teardown inside the original 90-second body deadline and join it before the next case acquires shared state. Preserve the fixture scenarios and assertions introduced by obviyus in openclaw#147390. Add a source-bound cancellation regression, forward context-local expect, and use the existing typed deferred owner.
Related: #147390, #149581
What Problem This Solves
Gateway placement-recovery tests can continue changing shared fixture state after a timed-out case, causing misleading recursion and authorization failures in later cases.
User Impact
No production behavior changes. The test suite now waits for the prior case to release Gateway, subprocess, state, and spy ownership before another case starts.
Why This Change Was Made
Keep teardown inside the original 90-second test body, fence continuation after cancellation, and have the finish hook join that same lifetime. A controlled regression exercises pending startup and teardown. The existing three recovery scenarios and their assertions from @obviyus in #147390 are preserved. No retry, longer deadline, or weakened authority check is introduced.
This is the independently consumable test prerequisite for #149581; it contains no worktree profile or generic checkout implementation.
Evidence
expectgetter.88c08ddaba47b921fef34783e5ae983e27aa97edis patch-identical to the qualified three-path increment. No profile/generic commits are included. Exact standalone-head CI and native maintainer gates remain required before landing.