DEFAULT aggregate bound on one whole flushRenderTicks call; a call
site that flushes several times inside ONE test passes a smaller budgetMs
(see the budgetMs parameter and the looped call site in
webgl-errors.spec.ts), because this bound is per CALL and per-call bounds
add up.
WHY an aggregate bound and not just TICK_TIMEOUT_MS: the per-tick
bound is paid up to ticks times, twice per iteration (once for the kick,
once for the confirmation wait), and a kick that goes unanswered does not
end the loop. Without this budget flushRenderTicks(page, 10) could spend
~10 x (3 s + 3 s) = 60 s — the entire per-test budget, reproducing exactly
the opaque Test timeout of 60000ms exceeded this change exists to
eliminate.
With it, the worst case is bounded by construction: the flush stops as soon
as the budget is spent, and each individual wait is clamped to the remainder,
so one call costs at most COUNTER_PROBE_TIMEOUT_MS (the baseline
probe, taken before the budget starts) + FLUSH_BUDGET_MS = 15 s. A
reportFlushVerdict call afterwards adds at most another
COUNTER_PROBE_TIMEOUT_MS, for 20 s total across both — comfortably
inside a per-test budget of playwright.config.ts's 60 s (120 s in
webgl-errors.spec.ts, which raises it at the describe level) alongside ONE
page.goto plus waitForLuxarReady. 10 s is ~10x the measured cost of the largest flush any
call site asks for (10 ticks at ~114 ms each is ~1.1 s). A test that loads
five scenes in one body cannot afford 20 s five times over, which is what
budgetMs is for.
DEFAULT aggregate bound on one whole flushRenderTicks call; a call site that flushes several times inside ONE test passes a smaller
budgetMs(see thebudgetMsparameter and the looped call site inwebgl-errors.spec.ts), because this bound is per CALL and per-call bounds add up.WHY an aggregate bound and not just TICK_TIMEOUT_MS: the per-tick bound is paid up to
tickstimes, twice per iteration (once for the kick, once for the confirmation wait), and a kick that goes unanswered does not end the loop. Without this budgetflushRenderTicks(page, 10)could spend ~10 x (3 s + 3 s) = 60 s — the entire per-test budget, reproducing exactly the opaqueTest timeout of 60000ms exceededthis change exists to eliminate.With it, the worst case is bounded by construction: the flush stops as soon as the budget is spent, and each individual wait is clamped to the remainder, so one call costs at most COUNTER_PROBE_TIMEOUT_MS (the baseline probe, taken before the budget starts) + FLUSH_BUDGET_MS = 15 s. A reportFlushVerdict call afterwards adds at most another COUNTER_PROBE_TIMEOUT_MS, for 20 s total across both — comfortably inside a per-test budget of
playwright.config.ts's 60 s (120 s inwebgl-errors.spec.ts, which raises it at the describe level) alongside ONEpage.gotopluswaitForLuxarReady. 10 s is ~10x the measured cost of the largest flush any call site asks for (10 ticks at ~114 ms each is ~1.1 s). A test that loads five scenes in one body cannot afford 20 s five times over, which is whatbudgetMsis for.