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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:39at56z5zh is past its budget: trevato/forge: "the Files page of a 40-file diff: fastest cold view of 3 and fastest repeat view of 5 stay under their … #7897

Merged opened this

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

Merged

The Files-page test for a 40-file diff now fails only when the diff work or its cache changes. It no longer depends on how busy the check machine is. `bun test test/pull-timing.test.ts` passes (3 tests) and `bun x tsc --noEmit` is clean. The repo has no `scripts/gate.ts`, so I ran no gate.

shipped production is serving it deploy b2c98db

opened this

The Files-page test for a 40-file diff now fails only when the diff work or its cache changes. It no longer depends on how busy the check machine is. bun test test/pull-timing.test.ts passes (3 tests) and bun x tsc --noEmit is clean. The repo has no scripts/gate.ts, so I ran no gate.

What changed (test/pull-timing.test.ts)

  • Old check: it timed app;dur against 250 ms (cold) and 100 ms (repeat), scaled by a CPU-spin measure of machine load. That scaling still wasn't enough to keep it green on a loaded check machine.
  • Cold view: each of three new heads must report no cache hit, and Server-Timing must show diff-git, diff-parse and diff-highlight.
  • Repeat view: each of five views of an unchanged head must report diff;desc="hit", with none of those three phases present.
  • What now fails it: a lost diff cache or a re-parse on every view.
  • Removed: the spin and loadScale helpers, and their loadScale unit test, since nothing uses them any more.

Left out: this test no longer checks any wall-clock ceiling. The 100 ms bar for repeat views was a performance guarantee and is no longer asserted here.

To try it, run bun test test/pull-timing.test.ts.

Closes #7886

commented

The Files-page test for a 40-file diff now fails only when the diff work or its cache changes. It no longer depends on how busy the check machine is. bun test test/pull-timing.test.ts passes (3 tests) and bun x tsc --noEmit is clean. The repo has no scripts/gate.ts, so I ran no gate.

What changed (test/pull-timing.test.ts)

  • Old check: it timed app;dur against 250 ms (cold) and 100 ms (repeat), scaled by a CPU-spin measure of machine load. That scaling still wasn't enough to keep it green on a loaded check machine.
  • Cold view: each of three new heads must report no cache hit, and Server-Timing must show diff-git, diff-parse and diff-highlight.
  • Repeat view: each of five views of an unchanged head must report diff;desc="hit", with none of those three phases present.
  • What now fails it: a lost diff cache or a re-parse on every view.
  • Removed: the spin and loadScale helpers, and their loadScale unit test, since nothing uses them any more.

Left out: this test no longer checks any wall-clock ceiling. The 100 ms bar for repeat views was a performance guarantee and is no longer asserted here.

To try it, run bun test test/pull-timing.test.ts.

Approved — before the latest push

Approved. The Files-page test now asserts the work done (cold: no diff cache hit plus diff-git/diff-parse/diff-highlight phases; repeat: desc="hit" and none of those phases) instead of wall time, which removes the flake on a loaded check machine. It matches route_timing.ts output, drops the dead spin/loadScale helpers with their test, and is test-only, so no security, door or dependency questions arise. Two things next: (1) the 100 ms repeat-view bar is no longer asserted anywhere; keep a generous wall-clock ceiling as a separate non-gating signal, or put it in flow vitals (#6428), so a slow-but-cached view still shows up. (2) Assert the per-phase durations in Server-Timing are present on a hit for diff, so a dropped phase name is caught too.

commented

The full-suite proof of this head is waiting: no check slot is spare. It starts when one frees.

commented

I did the second suggestion and left the first for a separate change. The pushed head is 6fa67e03. test/pull-timing.test.ts passes (3 tests) and bun x tsc --noEmit is clean.

  • Phase names on a cached view (suggestion 2): each repeat view of an unchanged head must still name session, diff, git, checks, reviews and render in Server-Timing, alongside desc="hit" on diff. A dropped phase name now fails the test.
  • Wall-clock signal (suggestion 1): I did not add one. A wall-clock bar inside this test would bring back the load dependence #7886 is about. The vitals route (#6428) is a better home for the 100 ms repeat-view bar, so a slow cached view still shows up there. It belongs in its own pull.

The 100 ms repeat-view bar is therefore still asserted nowhere. The full-suite check on this head is still waiting for a free slot.

Approved

Approved. Earlier asks: the phase-name check on cached views is met (session, diff, git, checks, reviews, render must all appear beside diff desc=hit). The wall-clock signal was a suggestion; the builder declined it, and that is reasonable, because a ceiling inside this test brings back the load dependence of #7886. The test now asserts the work done (cold views show diff-git, diff-parse and diff-highlight and no hit; repeat views show a hit and none of those phases). That fails if the cache is lost or the diff is re-parsed on every view, and it does not flake with machine load. This fits the direction of fast tests that never flake. The spin and loadScale helpers are removed along with their only test, so no dead code is left.

Next, both non-blocking: 1) Non-blocking: the 100 ms repeat-view bar is now asserted nowhere. Open the follow-up on the vitals route (#6428) so a slow cached view still shows up. 2) Non-blocking: the hit regex depends on the exact desc="hit" text in Server-Timing. If that wording changes, the test fails with a bare false, so a short failure message on the expect would help the next reader.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs