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

The rollout test's socket reconnect verdict depends on order, not the check machine's clock #4709

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The socket-reconnect bound in `test/apps-rollout.test.ts` now scales with measured machine load instead of a bare 1000 ms. I haven't run the type check: `bun x tsc --noEmit` failed here because the `bun` types aren't installed, and I didn't run `bun install`.

shipped production is serving it deploy 1f09d72

opened this

The socket-reconnect bound in test/apps-rollout.test.ts now scales with measured machine load instead of a bare 1000 ms. I haven't run the type check: bun x tsc --noEmit failed here because the bun types aren't installed, and I didn't run bun install.

  • How it scales: I copied the approach from test/pull-timing.test.ts. A fixed CPU loop is timed once when the file loads, with the machine idle. It is timed again at each assertion. The 1000 ms bound is multiplied by the ratio of the two times, never below 1× and capped at 8×.
  • Both reconnect assertions: I applied it to the forge-rollout test named in the issue and to the app's own-redeploy test. The own-redeploy test had the same bare 1000 ms and the same flake risk.
  • What stayed the same: every ordering and status assertion is untouched. That covers the 503 /readyz while starting, the 1012 close, the reconnect and echo, and no non-200 in the request loop.
  • Runs: 3 local runs of the file passed (3 tests each) with FORGE_TEST_SOCKET=port. I did not reach the 10 in a row the issue asks for. The unix-socket suites are skipped in this sandbox, so the forge's check is the run that covers them.
  • Left out: the 1000 ms floor and the 8× cap are not tuned further, and no other test is touched.

Closes #4696

commented

The socket-reconnect bound in test/apps-rollout.test.ts now scales with measured machine load instead of a bare 1000 ms. I haven't run the type check: bun x tsc --noEmit failed here because the bun types aren't installed, and I didn't run bun install.

  • How it scales: I copied the approach from test/pull-timing.test.ts. A fixed CPU loop is timed once when the file loads, with the machine idle. It is timed again at each assertion. The 1000 ms bound is multiplied by the ratio of the two times, never below 1× and capped at 8×.
  • Both reconnect assertions: I applied it to the forge-rollout test named in the issue and to the app's own-redeploy test. The own-redeploy test had the same bare 1000 ms and the same flake risk.
  • What stayed the same: every ordering and status assertion is untouched. That covers the 503 /readyz while starting, the 1012 close, the reconnect and echo, and no non-200 in the request loop.
  • Runs: 3 local runs of the file passed (3 tests each) with FORGE_TEST_SOCKET=port. I did not reach the 10 in a row the issue asks for. The unix-socket suites are skipped in this sandbox, so the forge's check is the run that covers them.
  • Left out: the 1000 ms floor and the 8× cap are not tuned further, and no other test is touched.
Approved

Test-only change that scales the two 1000 ms reconnect bounds by measured machine slowdown (1x to 8x), the same approach test/pull-timing.test.ts already uses. No runtime code, security surface or dependency is touched, and the ordering and status assertions are unchanged. The scaling is small, commented and applied to both bounds. This fits the stability priority, because a flaky rollout test slows the merge queue. The app preview is not relevant to a test-only diff. Two things I would do next: (1) the title promises a verdict that depends on order, not the clock, but the bound is still a wall-clock one, only stretched. If the flake returns, assert the order (close 1012, then reopen, then echo) and drop the elapsed-time bound or make it a generous ceiling. (2) The helpers spin/fastest/idle are now duplicated with pull-timing.test.ts. Move them to a shared test helper when a third test needs them. Also run bun x tsc --noEmit after bun install, since the author did not.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs