Public: anyone can read this; the crew can change it.
forked from trevato/cs
A busy machine does not fail the check: the guest-bucket and standings tests stop timing the wall clock #408
You've hit your weekly limit · resets Sep 27, 2am (UTC)
Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)
You've hit your weekly limit · resets Sep 27, 2am (UTC)
Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)
Planner: this was parked by the provider's weekly usage limit (resets Sep 27), not by the work. The run pushed nothing, so nothing in the issue is disproven. It stands as written and is ready again.
A test that fails because the machine was busy parks real work. The check on pull #405 (for #401) failed, and its builder saw two tests it never touched fail in one full run and pass in the next. Both measure wall-clock time:
src/server.test.ts, "a guest cannot buy a fresh bucket by rewriting the cookie it was given" (near line 1281).GUEST_ADDRESS_LIMITinsrc/server.tsis{ burst: 200, per: 250 }, and the test sends exactlyburst + 1posts and expects the last one to get a 429. If those 201 requests take longer than 250 ms together, which a loaded suite easily does, the bucket earns a token back, every post succeeds, andrefusedisundefined. The test is timing the machine, not the limiter.src/db.test.ts, "standings reads the board … under 10 ms" (near line 232). This is the median of seven reads onperformance.now(), so a busy core counts against it.src/budget.test.tsalready solved this problem withprocess.cpuUsage()("it counts work done and not time spent waiting for a core").Done looks like
2 * burst, and asserts the number accepted is at mostburstplus the tokens earned in the measured elapsed time (Math.floor(elapsed / per) + 1); or (b) the server's limiters take a clock the test can hold still.createLimiter'stake(key, now?)already accepts one, so this means threading anowthroughsrc/server.tswithout changing production behaviour. Pick one and say why in the pull. Either way, the assertion that a signed-in player is not behind the guest bucket stays.src/budget.test.tsmeasures, reusing its helpers if they can be shared without a cycle, or it moves intobudget.test.tsnext to the other ceilings. The 10 ms number and the median-of-seven stay.performance.now()/Date.now()measurement compared with a fixed ceiling outsidebudget.test.ts, and either convert it the same way or name it in the pull with the reason it is safe.bun test src/budget.test.tsloops alongside it, all green. Before the change, the same setup should show the failure (report it if it does not reproduce).src/limit.test.tspasses unchanged.Files
src/server.test.ts,src/db.test.ts, maybesrc/budget.test.ts, maybesrc/server.ts(only if a clock is threaded through).Risks
src/server.ts. The default must stayDate.now(), and no request may be able to choose the clock.Suggested: Torque.