From f8536cad5d142293a01ecc6507c6b72d06bc6984 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Sun, 13 Sep 2026 12:19:26 -0400 Subject: [PATCH] docs: address Copilot review round 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 5000 arms of #2335's re-run each had exactly one red test — the asyncUtilTimeout guard refusing the raised value — so "0 failures in every arm" was a misstatement; both comments now say so. And the AGENTS.md rule still gave the expiring-wait mechanism as the reason the pin was measured worse, which the corrected record contradicts; it now cites both measurements and keeps the mechanism as the hazard the rule guards against. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01PsmUAZ6aLUAFqenjJKSSRp Signed-off-by: cliffhall --- AGENTS.md | 16 ++++++++++------ clients/web/src/test/asyncUtilTimeout.test.ts | 5 +++-- clients/web/src/test/setup.ts | 6 ++++-- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 2cc2f883..e002b2b2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -435,12 +435,16 @@ free to run a full `local:gate`). Raising a budget nobody chose hides no race. tool can be asked to resolve; assert at runtime when it is about behavior. - **A budget is stated, which is not the same as raised.** Testing Library's `asyncUtilTimeout` is pinned at its own default in both web setup files - because raising it was *measured worse*: a wait that is meant to expire — - a test asserting something never appears, a poll allowed to run out — spends - its whole budget on the happy path, so a raise is a proportional cost on - exactly those tests and starves the worker pool. Measure before raising a - budget that a passing test can spend in full; the call-site comment records - the three-arm run. + because raising it was *measured* and found to buy nothing: #2323's + three-arm run went red at 5000, and #2335's interleaved re-run on a leased + machine found no web test that lets a Testing Library wait expire on its + passing path and no difference between 1000 and 5000 beyond the guard + refusing the raised value. The hazard the rule guards against is still + real: a wait that is meant to expire — a test asserting something never + appears, a poll allowed to run out — spends its whole budget on the happy + path, so a raise is a proportional cost on exactly those tests. Measure + before raising a budget that a passing test can spend in full; the + call-site comment records both runs. - **An inner budget must be strictly smaller than the budget enclosing it.** `waitFor({ timeout: N })` inside a test whose own budget is `N` can never win: the test expires first and reports a timeout naming neither the wait nor its diff --git a/clients/web/src/test/asyncUtilTimeout.test.ts b/clients/web/src/test/asyncUtilTimeout.test.ts index 116ed9fe..e13a8cc6 100644 --- a/clients/web/src/test/asyncUtilTimeout.test.ts +++ b/clients/web/src/test/asyncUtilTimeout.test.ts @@ -26,8 +26,9 @@ import { getConfig } from "@testing-library/react"; * to expire spends the whole budget on the happy path, so a 5x raise is a 5x * cost on those tests — was checked on #2335 and does not hold here: no web * test lets a Testing Library wait expire on its passing path, and the same - * three-arm protocol re-run interleaved on a leased machine showed 0 failures - * in every arm and 0 tests at or above 5000ms with the raise in place. Raising + * three-arm protocol re-run interleaved on a leased machine showed no failure + * in any arm beyond this very assertion refusing the raised value, and 0 tests + * at or above 5000ms with the raise in place. Raising * the budget buys nothing, so the pin stays at the default until a measurement * says otherwise. `setup.ts` carries the full record. * diff --git a/clients/web/src/test/setup.ts b/clients/web/src/test/setup.ts index 7531a53c..dae9776c 100644 --- a/clients/web/src/test/setup.ts +++ b/clients/web/src/test/setup.ts @@ -31,8 +31,10 @@ import { cleanup, configure } from "@testing-library/react"; // expiring-wait shape against Testing Library across the unit, `core/`, // integration and story files; no test at or above 2000ms in a full unit run; // and the same three-arm protocol re-run interleaved on a leased machine -// (1000 / 5000 / reverted, three rounds) gave 0 failures in every arm and -// 0 tests at or above 5000ms with the raise in place. Nothing on the passing +// (1000 / 5000 / reverted, three rounds) gave 0 failures in every arm — the +// one red test in each 5000 arm being `asyncUtilTimeout.test.ts` refusing the +// raised value, which is the guard doing its job — and 0 tests at or above +// 5000ms with the raise in place. Nothing on the passing // path spends this budget, so raising it buys nothing — and the #2323 reds // read as ambient load the arms did not share (an inference from that data, // not a re-measurement of the original run).