Files
multica/server/pkg/agent
2c25c20da5 MUL-7244 test: fix the two flakes that turned main red (#8258)
* test(agent): drain the omp fixture's stdin with a shell builtin

TestOmpExecuteDefaultsToOmpBinary replaces PATH with the fixture directory
so the backend has to resolve "omp" by name. That leaves no external command
on PATH, so the fixture's `cat > /dev/null` drain failed with "cat: not
found" and the script ran straight through to its exit — closing the read end
while the backend was still writing the prompt. Winning that race hid the
problem; losing it failed the run with "omp prompt write failed: broken pipe",
which turned main red (MUL-7244).

Drain with a shell builtin instead, so the fixture honours the same
read-to-EOF contract as real omp without depending on PATH.

Co-authored-by: multica-agent <[email protected]>

* test(daemon): size the blocked-/start prepare budget for CI

TestRunTask_PrepareTimeoutStopsLeaseDuringBlockedStartTask armed a 150ms
prepare deadline and then required runTask to reach /start before it expired.
Everything runTask does first — the isolated execution environment, its
sidecars, the task temp dir — is real filesystem work: ~15ms on an idle
developer machine, but an order of magnitude more on a loaded CI runner under
-race. When preparation outran the budget the deadline fired before /start,
and the test failed with "runTask did not reach /start" (MUL-7244).

Raise the budget to 2s, which keeps ~20x headroom over the observed CI cost,
and wait for the /start handler instead of sampling it — runTask returns as
soon as the deadline cancels the in-flight RoundTrip, which can beat httptest
scheduling the goroutine that records the entry. That is the same observation
race the prepare-lease counter above already documents.

Co-authored-by: multica-agent <[email protected]>

---------

Co-authored-by: J <[email protected]>
Co-authored-by: multica-agent <[email protected]>
2026-09-10 18:03:11 +08:00
..