Skip to content

test(tui): TestSubprocessClient_ProcessExitWithError is flaky — go build runs inside its own 5s deadline #2713

Description

@kovtcharov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions