Repository navigation
test(gateway): retain timed-out fixture ownership - #147844
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 maintainer review before merge. Reviewed September 15, 2026, 10:48 AM ET / 14:48 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR keeps cancelled Gateway test bodies attached to their cleanup lifecycle, propagates cancellation through fixture acquisition and client requests, and adds cleanup regression coverage and bounded startup diagnostics. Merge readiness✅ Ready for maintainer review The repair remains useful on current main, and no blocking defect was found in the introduced changes. Updated integrated validation addresses the previous review’s closeout concern while preserving the stated limitations of the historical run. Priority: P2 Review scores
Verification
How this fits togetherGateway integration tests start isolated processes, clients, and synthetic providers to exercise OpenClaw. Their fixture lifecycle must finish outstanding work before releasing processes, ports, and temporary state. flowchart TD
A[Test starts or cancels] --> B[Fixture lifetime]
B --> C[Gateway and client acquisition]
C --> D[Runtime test body]
D --> E[Ordered resource cleanup]
E --> F{Cleanup verified}
F -->|Yes| G[Release temporary state]
F -->|No| H[Retain state and report failure]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +5, Tests +2135. Total +2140 across 16 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep cancellation, pending work, and cleanup under the existing fixture lifetime, releasing test state only after its resource owners settle. Do we have a high-confidence way to reproduce the issue? Yes: the registered route-test callback and held cleanup regressions provide a concrete cancellation path, and current main lacks the corresponding lifetime wiring. This read-only review did not execute that path. Is this the best way to solve the issue? Yes: the adapter extends the existing lifetime owner, preserves ordinary assertions and timeout budgets, and handles partial acquisition without introducing a competing cleanup manager. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3c34fe88c1ac. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Integrate the existing fixture lifetime across Gateway test bodies and partial acquisition, joining provider handlers and ordered cleanup. Preserve assertions, budgets, bounded readiness diagnostics, and the original contributor history. Validated the exact integrated tree with 115 focused tests, the complete changed-file gate and build, six ordinary Gateway cases, and two controlled cancellation/sentinel cases on sanitized direct AWS. Independent review passed; the proof lease was released after preserving retained scratch.
|
Merged via squash.
|
* test(gateway): retain timed-out fixture ownership * test(gateway): narrow early route failure
What Problem This Solves
Gateway tests can keep running after Vitest times out or cancels its wrapper, leaving pending client work and racing fixture cleanup. This completes Vincent Koc's fixture-ownership repair in the existing PR and preserves his original commits.
User Impact
Internal test-only change. The actual asynchronous test body now remains owned until cancellation and cleanup settle. Gateway product behavior, existing test assertions and timeout budgets are unchanged.
Why This Change Was Made
Vitest rejects its wrapper without joining the original body. A narrow test fixture helper routes the five runtime consumers through the existing fixture lifetime, connects cancellation to acquisition/client shutdown, joins asynchronous provider handlers, and retains state when cleanup cannot be verified. Partial acquisition restores the environment synchronously before awaiting verified cleanup. The generic QA fixture and its other consumers keep their current contracts.
Bounded readiness diagnostics and startup tracing remain available for the large-catalog fixture. They do not establish the cause of the historical 60-second readiness failure. Active Memory, Concurrent Streams, Windows cron identity coverage and all 76 ordinary route requests remain intact.
Evidence
2164c12753af1252d45e41301c223b07bf0d87a7preserves contributor commit7835e6f4ee345a0fb9619adc7d7afbdf1ea7e153as its first parent and has the exact reviewed/tested treeffdff8b5ede8adbca76c0921d3948a7fb50d41cc.models.listrequest, then cancellation stopped the client and closed the incomplete provider request. Its actual body remained pending until the same test released a held finalizer. Exactly one finish hook completed, with no late requests, writes or success markers; the child exited, pipes closed, and its process group and isolated state were absent without supervisor intervention. This case performed no agent turn; the ordinary flows supply separate behavior proof.The integrated proof is Linux-only. Native Windows, full generated-output byte provenance, the historical readiness cause and production performance are not established by it. Two generated plugin source-capture scratch trees remained outside the controlled fixture's removed state; they were preserved before lease disposal, so this does not claim automatic cleanup of every temporary file. The existing benchmark
stopChildcontract still bounds return time without certifying process-group extinction.