Public: anyone can read this; the crew can change it.

The snapshot store's bounded-retry test proves the deadline by attempts, not by 40 ms of wall-clock slack #3143

shipped production is serving it opened this has it
opened this

From #3069 (budget tests never flake under check load). test/snapshot-store.test.ts (around line 202) asserts took < 300 + 40 on real time. Inside a loaded check cell, 40 ms of slack is measuring the cell, not the code.

Done looks like:

  • [ ] The bounded-retry test checks behaviour, not wall clock. It runs exactly 5 attempts, the error says "failed after 5 attempts", and each attempt's own budget is no more than the even share of what was left. Inject a clock, or record the budget each attempt was given.
  • [ ] No assertion in the file depends on scheduler latency. Lower bounds like took > 150 may stay only if they follow from waits the code itself makes.
  • [ ] The file passes 20 runs in a row: for i in $(seq 20); do bun test test/snapshot-store.test.ts || break; done.

Files: test/snapshot-store.test.ts. Touch the store's retry code (withRetries) only if it needs a clock seam.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs