openclaw/docs/reference/test
Peter Steinberger 8095d778b0
fix(test): Gateway e2e connect fails with 1006 when another fixture takes the instance port (#163003)
gateway-cold-agent-abort intermittently failed with `gateway closed during connect (1006)` about 260 ms into the test, too early for its own cold Gateway child to have answered readiness.

OpenClawTestInstance claims its port block and releases its reservation listener right before spawning the child. In-process Gateway fixtures picked ports with getGatewayE2ePortBlock(), a probe that released its claim before returning, and then started a Gateway whose listener retries EADDRINUSE every 500 ms. A fixture that probed the same candidate just before the instance claimed it won the port at the handoff, and the instance's /readyz was answered by that foreign Gateway (1006 while it closed, token mismatch while alive).

getGatewayE2ePortBlock is removed. acquireGatewayE2ePortBlock (beside startClaimedGateway) returns a held claim, and every caller keeps it until the Gateway or server bound to that port has closed, including same-port restarts, unstarted-claim guards, and listener-specific release in the MCP App conformance fixture. Kernel-assigned port-0 binders stay out of scope (the Linux pool excludes the ephemeral range). The test instance gains bounded post-start diagnostics (diagnose(), responder uptime vs child age, Linux listener owners, handshake stage in the close error).

Regression: an instance whose first candidate is an in-process Gateway E2E port must allocate a different port (fails on the probe-only helper).
2026-10-01 23:04:05 -07:00
..
docker.md refactor: retire pre-June config and upgrade test support (#156859) 2026-09-23 19:26:23 -07:00
lanes.md test(ui): record renderer stall evidence when Control UI e2e waits fail (#162767) 2026-10-01 17:17:23 +00:00
local.md perf(ci): run qualified unit tests with native Bun (#159988) 2026-10-01 17:28:11 -07:00
performance.md refactor: remove Tasks and TaskFlow runtime (#159179) 2026-09-27 10:40:29 -07:00
remote-proof.md fix(ci): keep admitted Testboxes alive and enforce current workflow limits (#163021) 2026-10-02 09:51:59 +07:00
runner-internals.md fix(test): Gateway e2e connect fails with 1006 when another fixture takes the instance port (#163003) 2026-10-01 23:04:05 -07:00