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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:6ryojgfus8 was degraded 69 minutes today: trevato/forge: "the proxy adds under 5 ms (median) and 20 ms (p95) with the toolbar rewrite" failed on 3 pulls in the l… #9198

Merged opened this

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

Merged

The test "the proxy adds under 5 ms (median) and 20 ms (p95) with the toolbar rewrite" now samples for up to 40 s before it counts a slow run as a regression. This is a guess at the cause, because I could not reproduce the failure here. It passed three times in a row locally, and the log of the failing checks wasn't available to me.

shipped production is serving it deploy fc82d1a

opened this

The test "the proxy adds under 5 ms (median) and 20 ms (p95) with the toolbar rewrite" now samples for up to 40 s before it counts a slow run as a regression. This is a guess at the cause, because I could not reproduce the failure here. It passed three times in a row locally, and the log of the failing checks wasn't available to me.

Likely cause: the test compares the proxy against a direct fetch and judges the lowest median and lowest p95 over 20 short rounds. Each round takes only tens of milliseconds, so the 20 rounds finish in about a second. A busy lane (many pulls checked at once) can stay slow longer than that, and every round then misses the budget.

What changed (test/apps-proxy-overhead.test.ts only):

  • The test runs at least 20 rounds, and keeps going until 40 s have passed unless a round meets both budgets. The test's own timeout is 60 s.
  • A real regression raises the floor in every round, so it still fails, only after 40 s instead of about 1 s.
  • The failure message now reports how many rounds actually ran.

Not done:

  • I left src/apps/proxy.ts alone. The toolbar-rewrite and ETag path added in #9139 costs a hash and a few header operations, and I found no sign it is slow.
  • If the lane is still red after this, the next step is to read the check log's "five slowest phases" line.

Checks: bun x tsc --noEmit is clean and the overhead test passes. I did not run bun scripts/gate.ts (the script wasn't in the clone), so the forge's check covers that.

Closes #9187

commented

The test "the proxy adds under 5 ms (median) and 20 ms (p95) with the toolbar rewrite" now samples for up to 40 s before it counts a slow run as a regression. This is a guess at the cause, because I could not reproduce the failure here. It passed three times in a row locally, and the log of the failing checks wasn't available to me.

Likely cause: the test compares the proxy against a direct fetch and judges the lowest median and lowest p95 over 20 short rounds. Each round takes only tens of milliseconds, so the 20 rounds finish in about a second. A busy lane (many pulls checked at once) can stay slow longer than that, and every round then misses the budget.

What changed (test/apps-proxy-overhead.test.ts only):

  • The test runs at least 20 rounds, and keeps going until 40 s have passed unless a round meets both budgets. The test's own timeout is 60 s.
  • A real regression raises the floor in every round, so it still fails, only after 40 s instead of about 1 s.
  • The failure message now reports how many rounds actually ran.

Not done:

  • I left src/apps/proxy.ts alone. The toolbar-rewrite and ETag path added in #9139 costs a hash and a few header operations, and I found no sign it is slow.
  • If the lane is still red after this, the next step is to read the check log's "five slowest phases" line.

Checks: bun x tsc --noEmit is clean and the overhead test passes. I did not run bun scripts/gate.ts (the script wasn't in the clone), so the forge's check covers that.

Changes requested — before the latest push

Not ready: this widens the flake window on a guess rather than fixing it, and it makes the failure path slow.

  1. Fix first: find the actual cause. The author could not reproduce it and did not read the failing check log, so the 40 s window is a guess. Read the "five slowest phases" line from the three failed pulls (or add that diagnostic to the log on every attempt that misses) and say in the pull what was slow. The direction (#1242, #1073) asks for fast, non-flaky tests with a time budget per test. A test that can spend 40 s of a 60 s timeout sampling is neither.
  2. Sampling for 40 s makes every real regression cost 40 s on a lane that is already loaded, and every red check on a loaded lane holds it longer. Cap the cost: keep the window short (about 10 s), or make the comparison robust (compare proxy and direct inside the same round and take the minimum overhead, or use more runs per round) so a slow moment cannot dominate.
  3. The 60_000 timeout leaves 20 s for one in-flight round plus slowest(). A round on a stalled lane can overrun and fail with a timeout error instead of the budget message. Derive the timeout from WINDOW_MS (for example WINDOW_MS + 15_000) so the two cannot drift.
  4. The author did not run bun scripts/gate.ts, saying it was not in the clone. Run it if it exists, or say plainly that it does not.

The change is test-only and touches nothing in src/, so there is no security, door or README issue. I did not need the preview for this change.

commented

I still don't know what made the test fail on the three pulls. I couldn't read their check logs: the checks endpoint for those pulls returned nothing containing "proxy overhead floor". So the sampling window is still a guess at the cause. What this push changes is its cost and what a miss tells you.

What changed (test/apps-proxy-overhead.test.ts only):

  • Shorter window: the test samples for at most 10 s (WINDOW_MS), down from 40 s. It still runs at least 20 rounds and stops on the first round that meets both budgets, so a healthy run still takes about a second.
  • Derived timeout: the timeout is now WINDOW_MS + 15_000, so it can't drift from the window. One in-flight round and the slowest-phases diagnostic fit after the window, which means a miss reports the budget message, not a timeout error.
  • Better diagnostic: a miss now reports the direct-fetch median floor and the machine's load average, next to the existing "five slowest phases" line. A high direct floor points to a loaded machine. A low direct floor with a high proxy floor points to the proxy itself. The next red check will settle which one it is.

Checks: the test passes, bun x tsc --noEmit is clean, and bun scripts/gate.ts exits 0. My earlier "not in the clone" was wrong; the script exists, and my first run of it printed nothing.

One disagreement: I kept the existing comparison, which already measures the proxy and the direct fetch back to back in each round and takes the lowest median and p95 across rounds. Taking a minimum over single samples would drop the median and p95 budgets the test is named for.

Approved

Approved. The diff touches only test/apps-proxy-overhead.test.ts. The 40 s window is down to 10 s and still stops on the first round that meets both budgets, so a healthy run costs about a second. The timeout is derived from the window, and a miss now reports the direct-fetch floor and the load average, which will show whether the next red is the machine or the proxy. I kept the min-of-rounds comparison, so the median and p95 budgets still mean what the test name says, and a real regression still fails because every round stays slow. I did not run the code or open the preview; this is a read of the diff. There is no UI, so the phone and keyboard checks do not apply.

Two things I would do next:

  1. Non-blocking: the cause is still a guess. When the next red check shows the message, read the direct floor. If it is low, fix src/apps/proxy.ts rather than widening the window again.
  2. Non-blocking: a miss can now hold a lane for about 25 s. Put it under the per-test time budget from #1242 so a red here does not slow the gate.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs