Repository navigation
fix(test): gateway loopback LAN proof flakes in parallel CI - #121389
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 10, 2026, 12:05 AM ET / 04:05 UTC. ClawSweeper reviewWhat this changesThe PR makes the gateway loopback/LAN QA producer obtain ephemeral ports reserved across IPv4 interfaces rather than choose a deterministic multi-port gateway block. Regression provenancePossible regression — suspected (failure trace; reviewed change). No predecessor PR is attributed. Merge readinessKeep open: this is a maintainer-owned, protected test-infrastructure fix for a credible parallel-CI port race. Source supports the intended boundary, but final Codex-policy approval is blocked because the required sibling Priority: P3 Review scores
Verification
How this fits togetherThe gateway network QA producer starts isolated loopback and LAN gateway instances, then probes HTTP and authenticated WebSocket behavior. Its chosen port feeds gateway startup and the resulting checks produce CI evidence artifacts. flowchart TD
A[Isolated QA environment] --> B[Port selection]
B --> C[Gateway startup]
C --> D{Loopback or LAN bind}
D --> E[HTTP and WebSocket probes]
E --> F[QA evidence and CI result]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests 0. Total 0 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the host-aware ephemeral-port selection for this single-listener QA producer, then complete final review in an environment with the required Codex source and exact-head CI. Do we have a high-confidence way to reproduce the issue? No live reproduction was run in this read-only review, but the current deterministic allocator and the producer’s concurrent lifecycle make the reported parallel-process collision source-reproducible. Is this the best way to solve the issue? Unclear: the proposed boundary is technically well matched to a sidecar-free LAN listener, but repository policy prevents a final Codex verdict until the required sibling source is available. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 232281fc74f7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready verification for
Latest ClawSweeper rank-up move disposition: exact-head CI is complete. Sibling Codex source inspection is not applicable because this patch does not touch or depend on Codex code, protocol, or runtime; the changed surfaces are the test-only Node |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where the gateway loopback/LAN QA proof could fail with
GatewayLockErrorwhen parallel CI processes selected the same deterministic test-port block.Observed on unrelated #121331 in Actions run 31347484644, attempt 1, where the LAN phase exhausted bind retries on
0.0.0.0:56008.Why This Change Was Made
The producer now uses the OS-ephemeral free-port helper for each gateway phase, probing on
0.0.0.0so the selected port is free across IPv4 interfaces. The shared helper keeps its existing loopback default for all current callers, and the producer retains its isolated state directory and awaited gateway shutdown between phases and in final cleanup.The deterministic gateway block allocator remains appropriate for tests that consume derived
port + Nlisteners; this producer disables those sidecars and does not need a block.User Impact
No product behavior changes. Parallel CI is less likely to fail an unrelated PR because a sibling process selected the same gateway test port.
Evidence
gateway-loopback-lan-access.test.tswithEADDRINUSEon the second deterministic block offset (56008); attempt 2 passed unchanged.node scripts/run-vitest.mjs test/e2e/qa-lab/runtime/gateway-loopback-lan-access.test.tspnpm check:changed -- src/test-utils/ports.ts test/e2e/qa-lab/runtime/gateway-loopback-lan-access.tspassed all selected format, guard, typecheck, lint, dead-code, and import-cycle checks via the documented local fallback (Testbox/Crabbox was unavailable in the orb).AI-assisted: yes. The implementation, failure logs, allocator ownership, network behavior, and validation results were manually inspected.