Repository navigation
Description
The hog test in tools/load assumes its process gets a whole CPU. On a busy runner it does not, and the test fails although the program did what it should. It failed the validation of the v0.5.95 release candidate.
What failed
- Run 41259129073 (Checks). It validated the candidate
7cc885d5801af8fc5d562b28f870b12001db7ad9. - Job 124708555500, "Unit (workspaces)". This was the only failing test ("1 tests failed").
- The test:
the hog program > holds its memory resident and spins a CPU for its time. - The assertion that failed, at
tools/load/tests/mock/hog.test.ts:155:expect(cpuSeconds).toBeGreaterThan(0.8). The test received0.72647.
Why
hogProgram (tools/load/src/mock/hog.ts:102-113 on main at e6bedb62a839ba9a38f716e463bf33acca0488ff) spins until time.monotonic() has passed its seconds. That is wall-clock time.
The test asks for 1 s, then asserts that the process's user CPU time (ru_utime) is above 80% of it. A runner that gives the process less than 80% of one CPU fails the test, although the hog spun for its full second.
Other jobs of the same validation hit their time limits, which points to a slow runner:
- the E2E scope of run 41259129054 was cancelled at its 3-minute limit;
- the Docs and Web container tests of Build run 41259129126 were cancelled after about 15 minutes.
The test came with 283eb05ce ("test(load): prove a 4 vCPU / 16 GB host holds a burst of agent runs", 2026-10-31).
Decision (Lead)
-
Kind:
bug, a flaky check. The commit type istest. -
Line: stable. The test is on
main. -
Priority: p0, because it failed a release candidate's validation.
-
Done means: the test passes however much CPU the runner gives the process. It must still prove two things: the hog holds its memory resident, and it spins a CPU rather than sleeping.
-
Left to the Coder: how to get there. Two ways:
- assert the CPU time against a bound a busy runner meets. One example is a share of the wall time the spin itself measured. A floor near zero would not prove a spin.
- make the hog spin until it has used its seconds of CPU (
time.process_time()), if the load model intools/loadmeans CPU time rather than wall time.
Choose by what
tools/loaduses the hog for, and give the reason in the plan. -
Proof: the test passes. If the worker can, also run it next to a competing CPU-bound process on the same core (for example with
taskset). If not, say that was not run. -
The release: v0.5.95 does not wait for this fix. If the test fails the next candidate's validation, the Lead reruns the failed job once, as for a runner outage.
Activity
test(load): prove the hog spins however much CPU a runner gives it