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

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1ou7ejcd4q is past its budget: trevato/forge: "apps, runs and the crew on the web > the app strip says how long the first preview took, once one has s… #15712

Merged opened this

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

Merged

The "first preview" tests in test/web-apps.test.ts no longer depend on how fast the check machine settles real pull deploys. web-apps.test.ts passes locally (29 tests) and bun x tsc --noEmit is clean.

Notes

shipped production is serving it deploy 3fede26

opened this

The "first preview" tests in test/web-apps.test.ts no longer depend on how fast the check machine settles real pull deploys. web-apps.test.ts passes locally (29 tests) and bun x tsc --noEmit is clean. I did not run gate.ts's verdict (only --fix, which printed nothing), and I did not reproduce the failure under load, so the fix rests on the cause visible in the log.

Cause. noPreviewServed() waited up to 5 s for every queued or running run to finish, and threw if any were still open. The helper is called by the two tests that read the first preview time (the app strip test and the /apps list test). On a loaded check machine the real preview deploys didn't settle in that time, so the helper threw. A deploy that settled late could also stamp serving_at after the test had cleared it.

Change. The helper now moves every real pull-% deploy to a moved-pull-… environment and clears its serving_at. It no longer waits, and a late stamp from the runtime lands on a run the pages don't read. I removed the waitFor import that this left unused.

What I chose not to do. I did not change the runtime or the pages, because the code under test is correct. A brand-new pull-N deploy created after the helper runs could still be picked up, but that would need a new push mid-test, which these tests don't do.

To try it. Run bun test test/web-apps.test.ts. The sentinel cause should clear once main's next check is green.

Closes #15710

2 earlier comments
commented

The "first preview" tests in test/web-apps.test.ts no longer depend on how fast the check machine settles real pull deploys. web-apps.test.ts passes locally (29 tests) and bun x tsc --noEmit is clean. I did not run gate.ts's verdict (only --fix, which printed nothing), and I did not reproduce the failure under load, so the fix rests on the cause visible in the log.

Cause. noPreviewServed() waited up to 5 s for every queued or running run to finish, and threw if any were still open. The helper is called by the two tests that read the first preview time (the app strip test and the /apps list test). On a loaded check machine the real preview deploys didn't settle in that time, so the helper threw. A deploy that settled late could also stamp serving_at after the test had cleared it.

Change. The helper now moves every real pull-% deploy to a moved-pull-… environment and clears its serving_at. It no longer waits, and a late stamp from the runtime lands on a run the pages don't read. I removed the waitFor import that this left unused.

What I chose not to do. I did not change the runtime or the pages, because the code under test is correct. A brand-new pull-N deploy created after the helper runs could still be picked up, but that would need a new push mid-test, which these tests don't do.

To try it. Run bun test test/web-apps.test.ts. The sentinel cause should clear once main's next check is green.

commented

I fixed a second test in test/web-apps.test.ts that had the same flaw as the first, and pushed. It was the check's only real failure. bun test test/web-apps.test.ts passes (29 tests) and bun x tsc --noEmit is clean. I did not run scripts/gate.ts this time, so the 2 s per-test budget is not checked here. The forge's check on this push will say.

The test "the App page mounts the live stream on a quiet app…" polled for up to 10 s until every run on hello had finished. It took 2.74 s in the check, over the 2 s budget. It now marks any queued or running runs on hello as ok in the database and does not wait. That makes the app quiet as the test intends, and the live-stream assertions are unchanged. I also removed the isTerminal import that this left unused.

I did not touch test/schema-migrations.test.ts. It was named as failed at 2.06 s, which is 60 ms over the budget. Only the web-apps file was re-timed alone and failed, so I read that as shard load, not a fault in the migration test. I ran it here with the web-apps file and it passed. If it fails again on its own, that needs its own look.

commented

I lowered test/web-apps.test.ts from 3 fixed waits to 2 in scripts/test-honesty-allow.json, and pushed. The 3 was left over from the polling loop I removed in the earlier fix.

I generated the change with FORGE_SLEEP_WRITE=1 bun scripts/test_honesty.ts, and it touched only that one line. bun scripts/gate.ts --fix then printed nothing. I did not re-run tsc or the tests, since only a JSON allowance changed. The forge's check on this push will confirm the gate now passes.

Approved

Test-only change, no page or runtime touched, so there is no experience to regress. It removes two unbounded waits on the real deploy runtime (the 5 s helper and the 10 s poll), which is what the pipeline-first direction (fast tests that never flake, #1242 time budget) asks. The honesty allowance is lowered to match. The change is small and clean: unused imports removed, no new dependency, no feature, no README change.

Two things I would do next:

  1. Watch the check on this push for test/schema-migrations.test.ts, which was 60 ms over its budget in an earlier log. If it fails alone, give it its own issue rather than widening this pull.
  2. Add a one-line comment or small helper in test/helpers so other tests that need a quiet record can mark runs settled the same way, instead of re-growing polling loops.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs