Repository navigation
fix(test): stop preflight mocks leaking into shared workers - #157207
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 24, 2026, 6:33 AM ET / 10:33 UTC. ClawSweeper reviewWhat this changesThe PR narrows the UI end-to-end preflight test’s HTTP mock to listener creation, restores it after cleanup, and checks that native HTTP and socket methods remain intact. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open. Current main retains the broad HTTP spy, and this focused PR addresses a test isolation defect that has not been merged. No actionable patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s UI end-to-end preflight opens a loopback HTTP listener before browser tests run. Its test fixture observes listener cleanup; leaked native mocks can affect later tests in a shared worker. flowchart LR
A[Fixture tests] --> B[Listener wrapper]
B --> C[Loopback preflight]
C --> D[Native HTTP listener]
D --> E[Listener cleanup]
E --> F[Restore wrapper]
F --> G[Later worker tests]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +38. Total +38 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the narrow fixture interception and native-method regression in this PR, subject to the repository’s normal exact-head merge gates. Do we have a high-confidence way to reproduce the issue? Yes, as a source-backed ordered worker scenario: current main broadly spies on node:http in a nonisolated test lane. This read-only review did not execute the scenario. Is this the best way to solve the issue? Yes. Mocking only listener creation preserves the real HTTP and socket implementations while retaining the existing listener-cleanup assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fe846d3c9498. 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.
|
* commit 'c4333da677cbdfe1bbaf783ed01c363ff39e93b8': (100 commits) fix(test): stop preflight mocks leaking into shared workers (#157207) fix(build): scope normalization declarations to package sources (#157174) fix: exit after validating Codex model references (#157323) fix(gateway): guard workspace adoption during active work (#157259) fix(update): rebuild stale Git runtimes when source is already current (#156996) fix: require a click before diagnosing failed updates (#157359) test(release): provide sealed artifact inputs to writer fixtures fix(ios): preserve chat state and adapt layout when iPad windows resize (#156683) fix(test): prepare native UI fixtures before compilation fix(test): await outbound delivery readiness before assertions fix: clarify deferred Codex catalog refresh warnings (#157352) fix(skills): refresh skills after watched directories are replaced (#156324) ci: reduce Node fixture overhead and defer seven release matrices (#157341) chore(test): stop Codex Computer Use and Signal batching tests flaking under load (#157334) fix(gateway): retain owned suspension status during restart (#157258) fix(ci): scope desktop status assertions to the selected worker chore(i18n): refresh native locales (#157337) test(daemon): use the native PowerShell probe budget (#157289) fix(exec): avoid gateway stalls during background task writes (#157177) test(cli): isolate preaction title setter state ...
Related: #157071
What Problem This Solves
The UI E2E preflight test leaves native HTTP and socket methods mocked for later tests in the same worker.
User Impact
No product behavior changes. Shared-worker tests retain Node's real HTTP and socket implementations after the preflight fixture finishes.
Why This Change Was Made
Wrap only
createServer, preserving the existing real-listener cleanup assertions. Restore that wrapper after listener cleanup, including teardown failures. A regression checks the actual built-in HTTP constructors and inherited stream/socket methods, following the existing narrownode:netfixture pattern.This changes one test file: 46 additions and 8 deletions; production delta is zero. Related broad HTTP(S) mocks in
src/secrets/egress-proxy/proxy-forward.test.tsandsrc/secrets/egress-proxy/proxy-server.lifecycle.test.tsremain a separate follow-up.Evidence
Socket.prototype.write. The original oversized-body consumer still passed. This demonstrates the ownership defect but does not establish the cause of the separate Node 24.20 CI timeout.