test(ui-server): time the busiest symbol as the best of five requests (#2208)

`answers in under 100 ms` took one wall-clock sample while the rest of the
suite ran in parallel, and failed under that load at 250-430 ms (three
times in one day of full-suite runs) while passing alone. It now takes the
fastest of five warm requests: contention is gone from at least one, and a
real slowdown is slow on every one.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Colby Mchenry
2026-09-30 21:34:36 +00:00
committed by GitHub
parent eb1452ba82
commit b8f2bd513e
+10 -3
View File
@@ -1093,9 +1093,16 @@ describe.runIf(CodeGraph.isInitialized(path.resolve(__dirname, '..')))(
await repoGet(`/api/node/${hit.id}`); // warm
const started = performance.now();
const res = await repoGet(`/api/node/${hit.id}`);
const elapsed = performance.now() - started;
// The fastest of a few requests: one sample, taken while the rest of the
// suite runs in parallel, measured the machine's load (250–430 ms) as
// often as the endpoint. A real slowdown is slow on every request.
let res!: Response;
let elapsed = Infinity;
for (let i = 0; i < 5; i++) {
const started = performance.now();
res = await repoGet(`/api/node/${hit.id}`);
elapsed = Math.min(elapsed, performance.now() - started);
}
expect(res.status).toBe(200);
const body = JSON.parse(res.body);