Version / branch / commit
main at 99721c76 (and PR branches based on it)
OS and environment
GitHub Actions windows-latest, job Smoke (windows-latest) → step Test (Fast Non-Race)
Steps to reproduce
Intermittent. Run the Windows smoke job, e.g. go test ./internal/tools/ -run TestExecCommandForegroundServerReturnsSessionAndServesHTTP on a loaded Windows runner.
Seen on two unrelated PRs so far:
Expected behavior
The test starts the http-server helper through exec_command, reads the listening <addr> line and gets zero-server-ok over HTTP, regardless of runner speed.
Actual behavior
The first exec_command result returns before the helper has printed its address, so the test fails before it ever reaches the HTTP check:
--- FAIL: TestExecCommandForegroundServerReturnsSessionAndServesHTTP (10.52s)
exec_command_test.go:378: server output did not include listening address: "Command is still running.\nsession_id: 1000\nUse write_stdin with session_id 1000 and empty chars to poll; send chars \"\\u0003\" to interrupt/stop it."
exec_command_test.go:596: test root C:\Users\RUNNER~1\AppData\Local\Temp\zero-exec-test-2025076317 still held after the cleanup deadline; leaving it
FAIL github.com/Gitlawb/zero/internal/tools 35.159s
Cause
internal/tools/exec_command_test.go:365-378 starts the server with "yield_time_ms": 500 and parses the listening address from that first result only. On a slow Windows runner, process start-up plus the helper's net.Listen can take longer than 500 ms. The session is still running correctly (session_id: 1000 is returned), and the address just hasn't been printed yet.
The "still held after the cleanup deadline" line follows from the early failure: the server process is still running when the temp root is removed.
Suggested fix
Don't depend on one fixed yield. After the start call, poll the session with write_stdin (empty chars, short yield_time_ms) and accumulate output until parseListeningAddress finds the address, with a generous deadline (e.g. 20 s). The test still checks that a foreground server returns a session_id and serves HTTP.
Version / branch / commit
mainat99721c76(and PR branches based on it)OS and environment
GitHub Actions
windows-latest, job Smoke (windows-latest) → step Test (Fast Non-Race)Steps to reproduce
Intermittent. Run the Windows smoke job, e.g.
go test ./internal/tools/ -run TestExecCommandForegroundServerReturnsSessionAndServesHTTPon a loaded Windows runner.Seen on two unrelated PRs so far:
internal/configonly): run 36345469382, commit8c05ee0531fe0e43Expected behavior
The test starts the
http-serverhelper throughexec_command, reads thelistening <addr>line and getszero-server-okover HTTP, regardless of runner speed.Actual behavior
The first
exec_commandresult returns before the helper has printed its address, so the test fails before it ever reaches the HTTP check:Cause
internal/tools/exec_command_test.go:365-378starts the server with"yield_time_ms": 500and parses the listening address from that first result only. On a slow Windows runner, process start-up plus the helper'snet.Listencan take longer than 500 ms. The session is still running correctly (session_id: 1000is returned), and the address just hasn't been printed yet.The "still held after the cleanup deadline" line follows from the early failure: the server process is still running when the temp root is removed.
Suggested fix
Don't depend on one fixed yield. After the start call, poll the session with
write_stdin(emptychars, shortyield_time_ms) and accumulate output untilparseListeningAddressfinds the address, with a generous deadline (e.g. 20 s). The test still checks that a foreground server returns asession_idand serves HTTP.