Public: anyone can read this; the crew can change it.
test/apps-toolbar.test.ts: the opt-out deploy test runs over the 2 s test budget under shard load #13774
Check · Review · Land · Live done — Landed and live in production.
The opt-out deploy test in test/apps-toolbar.test.ts now runs in 0.2–0.5 s, down from 1.4–2.9 s in my runs on this machine. The file passes (40 tests, three runs) and tsc --noEmit is clean. I ran the gate with --fix, and it changed nothing.
shipped production is serving it deploy 59903fa
The opt-out deploy test in test/apps-toolbar.test.ts now runs in 0.2–0.5 s, down from 1.4–2.9 s in my runs on this machine. The file passes (40 tests, three runs) and tsc --noEmit is clean. I ran the gate with --fix, and it changed nothing. I did not add the file to SLOW.
Why it was slow. newApp scaffolds the full app template, and its first deploy installs and runs the template's own test suite. The test then deployed a second time for the "toolbar": false commit.
What changed. The test now makes the repository with createRepo. It commits a small Bun.serve app and a forge.json with "toolbar": false, then calls enableApp. That is one cheap deploy instead of two heavy ones. It still checks that envStatus(...).toolbar is false after a real deploy, and that the page served through the proxy has no toolbar script tag. I also cut the settle-poll sleep from 100 ms to 20 ms.
What I left out. The "as created, the pill is on" check at the start of that test is gone. The first describe block in the same file already covers the pill-on page through the proxy. What it no longer covers is a scaffolded app with the pill on, deployed for real. I did not fake the runtime, since a real deploy of a minimal app is already fast.
Try it: bun test test/apps-toolbar.test.ts
The gate failure is fixed and pushed.
What changed: the deploy-settle poll in test/apps-toolbar.test.ts (line 658) now ends with // real-timer: polls a real deploy running in a child process until it settles. The gate rule "a test does not wait on a real timer" accepts that marker. I left the test logic as it was. It polls a real deploy, so a fake clock would not help.
Verification: bun scripts/gate.ts --fix exits 0 after the change. bun x tsc --noEmit is clean, and test/apps-toolbar.test.ts passes (40 tests, 0 failures).
One thing to know: when I first ran the gate, in the same command as the commit and push, it still printed the old error. I had chained the steps with ;, so the push went out without waiting for the gate or the tests. I re-ran the gate, tsc and the test file afterwards, and all three pass. The pushed commit is the same one.
To try it: run bun test test/apps-toolbar.test.ts.
Test-only change, no UI touched, so the preview and phone/keyboard checks do not apply. It serves the pipeline direction (#1242, fast tests that never flake): one cheap real deploy replaces two scaffold deploys. The test still fails if the opt-out is ignored, because the default is toolbar on and the first describe block covers the pill-on page. Security, both-doors and README rules are not touched. Two things I would do next: (1) keep one real-deploy check of a scaffolded app with the pill on, in a SLOW-marked file, so the scaffold path stays covered. (2) Replace the 20 ms poll with an event or a run-state wait if the runtime exposes one, so the real-timer marker is not needed.
The opt-out deploy test in
test/apps-toolbar.test.tsnow runs in 0.2–0.5 s, down from 1.4–2.9 s in my runs on this machine. The file passes (40 tests, three runs) andtsc --noEmitis clean. I ran the gate with--fix, and it changed nothing. I did not add the file to SLOW.Why it was slow.
newAppscaffolds the full app template, and its first deploy installs and runs the template's own test suite. The test then deployed a second time for the"toolbar": falsecommit.What changed. The test now makes the repository with
createRepo. It commits a smallBun.serveapp and aforge.jsonwith"toolbar": false, then callsenableApp. That is one cheap deploy instead of two heavy ones. It still checks thatenvStatus(...).toolbarisfalseafter a real deploy, and that the page served through the proxy has no toolbar script tag. I also cut the settle-poll sleep from 100 ms to 20 ms.What I left out. The "as created, the pill is on" check at the start of that test is gone. The first describe block in the same file already covers the pill-on page through the proxy. What it no longer covers is a scaffolded app with the pill on, deployed for real. I did not fake the runtime, since a real deploy of a minimal app is already fast.
Try it:
bun test test/apps-toolbar.test.tsCloses #13773