Repository navigation
test: gateway and CLI process-test hygiene - #118042
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 1:05 PM ET / 17:05 UTC. ClawSweeper reviewWhat this changesThe branch removes obsolete gateway test fixture data, skips an alias-dependent WebSocket test on hosts that cannot bind Merge readinessNo blocking correctness or security finding surfaced. This test-only PR remains necessary because current main still contains the stale gateway fixture field and the fixed-window CLI child-process helper; the final head replaces those narrow test-hygiene defects and includes direct after-fix terminal proof. Priority: P2 Review scores
Verification
How this fits togetherGateway startup tests verify that the server is ready before clients connect and that configured bind addresses work; CLI process tests launch the command-line entry point and assert its diagnostics and exit status. These paths feed local contributor runs and CI, not shipped runtime behavior. flowchart LR
Cases[Gateway and CLI test cases] --> Gateway[Gateway startup suite]
Cases --> Cli[CLI process suite]
Gateway --> AliasProbe[Loopback alias availability probe]
Cli --> ProcessWait[Child exit and stream completion]
AliasProbe --> Outcome[Test pass or explicit host skip]
ProcessWait --> Outcome
Before merge
Agent review detailsSecurityNone. PR surfaceTests +67. Total +67 across 5 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the three narrowly scoped test repairs, retaining the existing port-probe helper and the derived timeout ordering so macOS capability differences produce an explicit skip while genuine gateway and CLI regressions still fail. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main still contains the stale fixture and fixed-window helper, and the final-head terminal transcript directly exercises the repaired alias-skip and exit-code path. I did not execute the suites in this read-only review. Is this the best way to solve the issue? Yes. The patch repairs each defect at its owning test boundary: it deletes dead fixture input, probes host capability rather than weakening the Linux assertion, and makes the local CLI helper observe the process lifecycle instead of guessing with a fixed wait. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 059a98ebfd16. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
After-fix transcript + deadline-ordering repair (exact head
|
|
Merged via squash.
|
* test: gateway and CLI process-test hygiene * test: preserve CLI process timeout diagnostics
What Problem This Solves
Three test-hygiene defects observed during the plugin-lifecycle series (#117236…#117852):
src/gateway/server-startup-model-runtime.event-loop.test.tsstill passed thedeferConfiguredChannelFullLoadUntilAfterListenfixture key removed end-to-end by refactor(gateway): remove deferred channel load flag; 503 plugin routes until runtime ready #117852 — dead data readers silently ignore.src/gateway/server.startup-websocket-race.test.tsbinds127.0.0.2, which default macOSlo0doesn't alias — the test fails locally on Macs (EADDRNOTAVAIL, observed on unrelated branches) while passing on Linux CI.src/cli/help-exit.process.test.tsintermittently reported exit codenullon loaded CI runners: its subprocess helper used fixed-window waits, so a slow spawn looked like a missing exit.Why This Change Was Made
Dead key deleted (the intentional tolerant-parse regression in
installed-plugin-index-store.test.tsis untouched). The alias-specific race test now runtime-probes127.0.0.2bindability and skips with a clear reason where absent — the #117261 macOS-hygiene precedent — leaving Linux assertions intact. The CLI subprocess helper awaits exit and stream completion with a bounded 240s hard cap; the exit-code2assertion stays exact, and sibling process suites were checked (distinct harnesses — one-file fix, not a class).User Impact
None at runtime — test-only. macOS contributors get green local runs for these suites; CI loses a flake source.
Evidence
pnpm tsgo:testclean; changed-file oxlint, formatting,git diff --checkclean; structured autoreview clean.git diff --numstat: test files only).🤖 Generated with Claude Code
Review correction + transcript (added post-review)
Deadline ordering made structural: ordinary callers 100s (derived from the shared 120s Vitest constant), slow dotenv case paired 240s/250s; all 41 invocations verified. After-fix terminal transcript (alias skip with reason, exact exit-code-2 pass through the event-based harness): see the proof comment.