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

A test fails when a flow reading under src/flow/ reads the wall clock instead of taking `now` #6504

shipped production is serving it opened this has it
opened this

Part of #5930. The flow reads and alarms are tested by passing now in. One that calls Date.now() or new Date() with no argument is flaky by the hour, and a red gate on a flaky test is a clog.

Done:

  • [ ] test/flow-clock.test.ts reads every src/flow/*.ts and fails, naming file:line, on Date.now() or a no-argument new Date() outside a default parameter value (now = new Date() / now: Date | number = Date.now() stay allowed).
  • [ ] The files on main today pass, or the ones that do not are fixed in the same pull so they take now.
  • [ ] Runs in under 200 ms.

Files: test/flow-clock.test.ts, and any src/flow/ file it catches.

Before pushing: bun x tsc --noEmit and the new test.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs