test(bench): fan-out — don't gate on OC success rate, report numbers

Initial run showed OC parallel `--local` at 10-wide hits 40% failure
rate (17/30 across 3 runs). That's the finding, not a test bug —
process startup stampede + LLM rate limits. Bench now prints error
samples and reports the numbers instead of gating.

Minions side still gates at 90% (30/30 observed in practice).
This commit is contained in:
Garry Tan
2026-04-18 08:28:49 +08:00
parent efd395d9ad
commit 615e45cb1d
+14 -1
View File
@@ -146,6 +146,7 @@ describeBench('Bench: Fan-out (parent → 10 children in parallel)', () => {
test(`OpenClaw: ${RUNS} runs × ${CHILDREN} parallel --local spawns`, async () => {
const runs: RunResult[] = [];
const errorSamples: string[] = [];
for (let run = 0; run < RUNS; run++) {
const t0 = performance.now();
const results = await Promise.all(
@@ -154,12 +155,24 @@ describeBench('Bench: Fan-out (parent → 10 children in parallel)', () => {
const wallMs = Math.round(performance.now() - t0);
const ok = results.filter((r) => r.ok).length;
const fail = CHILDREN - ok;
for (const r of results) {
if (!r.ok && r.error && errorSamples.length < 3) {
errorSamples.push(r.error.slice(0, 200));
}
}
runs.push({ ok, fail, wallMs });
console.log(
` [openclaw-fanout] run=${run + 1} ok=${ok}/${CHILDREN} wallMs=${wallMs}`,
);
}
if (errorSamples.length > 0) {
console.log(` [openclaw-fanout] error samples:`);
for (const e of errorSamples) console.log(` - ${e}`);
}
console.log(`\n${summarize('[openclaw-fanout]', runs)}`);
for (const r of runs) expect(r.ok).toBeGreaterThanOrEqual(Math.floor(CHILDREN * 0.8));
// Observational: report numbers, don't gate. OC parallel spawns are
// known-flaky under load (LLM rate limits, process startup stampede).
// The failure rate IS the finding.
expect(runs.length).toBe(RUNS);
}, 20 * 60_000);
});