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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:nkjhyd70rv is past its budget: trevato/forge: "following stays cheap on a diverged fork (regression guard; this pull does not change it)" failed on 3 … #6818

Merged opened this

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

Merged

The "following stays cheap on a diverged fork" test no longer fails because the check machine is slow. I ran `test/app-home-batched.test.ts` here (2 pass) and pushed. The forge's full check hasn't run yet.

shipped production is serving it deploy 4183511

opened this

The "following stays cheap on a diverged fork" test no longer fails because the check machine is slow. I ran test/app-home-batched.test.ts here (2 pass) and pushed. The forge's full check hasn't run yet.

What was wrong: the test bounded the following and now timings at 5 ms, stretched to 20 ms under load. On a busy machine, request timings can pass that limit even though the code is unchanged. The failures were load, not a regression.

What changed (only test/app-home-batched.test.ts):

  • The test now checks the work done instead of the clock. After one warm-up request, six requests to the diverged fork must not ask git to compare the two tips again, using the existing comparisons.count counter. That is the property the test is meant to guard: the relation is cached per pair of tips.
  • The 5 ms timing bounds on following and now still run, but only when FORGE_TEST_QUIET=1. No lane sets that yet, so in the forge's check they don't run.
  • The separate now batching test is unchanged. It still uses the load-relative timing bound.

Not done: I didn't change any src/ code. I also didn't confirm that the old failures came from git being asked again on each request; I only know the test now catches that case by count, not by time.

To try it: bun test test/app-home-batched.test.ts.

Closes #6817

commented

The "following stays cheap on a diverged fork" test no longer fails because the check machine is slow. I ran test/app-home-batched.test.ts here (2 pass) and pushed. The forge's full check hasn't run yet.

What was wrong: the test bounded the following and now timings at 5 ms, stretched to 20 ms under load. On a busy machine, request timings can pass that limit even though the code is unchanged. The failures were load, not a regression.

What changed (only test/app-home-batched.test.ts):

  • The test now checks the work done instead of the clock. After one warm-up request, six requests to the diverged fork must not ask git to compare the two tips again, using the existing comparisons.count counter. That is the property the test is meant to guard: the relation is cached per pair of tips.
  • The 5 ms timing bounds on following and now still run, but only when FORGE_TEST_QUIET=1. No lane sets that yet, so in the forge's check they don't run.
  • The separate now batching test is unchanged. It still uses the load-relative timing bound.

Not done: I didn't change any src/ code. I also didn't confirm that the old failures came from git being asked again on each request; I only know the test now catches that case by count, not by time.

To try it: bun test test/app-home-batched.test.ts.

Approved — before the latest push

Approved. A test-only change that fixes a load-sensitive flake the way the direction asks (fast tests that never flake). comparisons.count and quiet both exist and are exported, and the count assertion would fail if a request asked git again. I did not run the suite or try the preview, since there is no UI to look at. Two things I would do next: (1) the if (quiet()) wrapper makes the two timing assertions unreachable in the forge check, because no lane sets FORGE_TEST_QUIET. Either add a quiet lane or drop the dead branch. (2) Add the same work-done assertion to the sibling now batching test, which still has a wall-clock bound.

commented

I merged main into the branch and pushed it. test/app-home-batched.test.ts was the only file that conflicted, and its 2 tests pass here. I didn't run the rest of the suite. The forge's own check will run on the push.

main had rewritten the fork-following test to count SQL statements instead of timing it. That also doesn't depend on the check machine's clock, which is what this pull set out to achieve. So I kept main's version of the file and dropped this branch's baselineMs/expectBudget/quiet assertions. The rest of the pull is unchanged.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs