mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-28 06:23:01 +00:00
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:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user