TestSubprocessClient_ProcessExitWithError fails intermittently in CI on an unloaded-machine assumption. It blocked #2700 once, then passed on re-run with no code change.
The test compiles a helper binary with go build inside the 5-second context deadline it then measures against:
cmd := exec.Command(goExe, "build", "-o", binPath, srcPath) // subprocess_test.go:210
...
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) // :219
On a loaded ubuntu-latest runner the build can consume most of that budget, so the subprocess never emits its AgentErrorEvent before the context expires. The failing run took 4.34s — right at the edge. It passes locally with -count=5 on both main and a feature branch, which is what makes it read as a real failure when it fires.
Two ways to fix it, either fine:
- Move the
go build outside the deadline — build first, then start the timer. The deadline is meant to bound the subprocess, not the toolchain.
- Build the helper once for the package (
TestMain) instead of per-test, which also speeds up the suite.
Raising the timeout would paper over it; the build simply should not be inside the window being measured.
Seen at https://github.com/amd/gaia/actions/runs/30562638169/job/90939278513.
TestSubprocessClient_ProcessExitWithErrorfails intermittently in CI on an unloaded-machine assumption. It blocked #2700 once, then passed on re-run with no code change.The test compiles a helper binary with
go buildinside the 5-second context deadline it then measures against:On a loaded
ubuntu-latestrunner the build can consume most of that budget, so the subprocess never emits itsAgentErrorEventbefore the context expires. The failing run took 4.34s — right at the edge. It passes locally with-count=5on bothmainand a feature branch, which is what makes it read as a real failure when it fires.Two ways to fix it, either fine:
go buildoutside the deadline — build first, then start the timer. The deadline is meant to bound the subprocess, not the toolchain.TestMain) instead of per-test, which also speeds up the suite.Raising the timeout would paper over it; the build simply should not be inside the window being measured.
Seen at https://github.com/amd/gaia/actions/runs/30562638169/job/90939278513.