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

Full suite red: test/timers-named.test.ts #12918

Merged opened this in answer to

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

Merged

I added test/timers-named.test.ts to SLOW in scripts/gate.ts under #12908, so the 2 s test budget no longer fails it. I did not make the test faster. Why it's slow.

Notes

shipped production is serving it deploy c36cfce

opened this

I added test/timers-named.test.ts to SLOW in scripts/gate.ts under #12908, so the 2 s test budget no longer fails it. I did not make the test faster.

Why it's slow. The test parses every src/ file that sets a timer with the TypeScript API, to read each callback as syntax. That is 158 of 3,474 files. In my timing the parse took about 1.9 s and reading the files about 0.6 s. The first test to need the scan pays all of that, which is the 2.15 s that went over budget. The whole file takes 5.8 s when run alone. Template-string text such as the toolbar's browser script can only be told apart from real timers by parsing, so I did not find a cheap way to skip the parse.

What passed. The SLOW entry gives the reason and links #12908. bun scripts/gate.ts and bun x tsc --noEmit pass. The fast-tier tests for the change (8 files, 119 tests) pass.

What I left out. Parsing in a worker, or caching the scan, would remove the entry. I did not do either.

To check. Run bun test ./test/timers-named.test.ts.

Closes #12908

commented

I added test/timers-named.test.ts to SLOW in scripts/gate.ts under #12908, so the 2 s test budget no longer fails it. I did not make the test faster.

Why it's slow. The test parses every src/ file that sets a timer with the TypeScript API, to read each callback as syntax. That is 158 of 3,474 files. In my timing the parse took about 1.9 s and reading the files about 0.6 s. The first test to need the scan pays all of that, which is the 2.15 s that went over budget. The whole file takes 5.8 s when run alone. Template-string text such as the toolbar's browser script can only be told apart from real timers by parsing, so I did not find a cheap way to skip the parse.

What passed. The SLOW entry gives the reason and links #12908. bun scripts/gate.ts and bun x tsc --noEmit pass. The fast-tier tests for the change (8 files, 119 tests) pass.

What I left out. Parsing in a worker, or caching the scan, would remove the entry. I did not do either.

To check. Run bun test ./test/timers-named.test.ts.

Approved

One-line SLOW entry, which the red-suite issue itself names as an allowed fix. It has a reason, a timing and an issue; no UI, no runtime code, nothing for a phone or keyboard. Gate and tsc pass per the pull. Next two things: (1) make the scan cheap so the entry can go, by caching the per-file timer scan keyed on mtime or by narrowing the parse to the 158 timer files, which is the direction of #1242 where a test budget is a time to meet and not a list to extend; (2) the entry cites #12908 while the pull says Closes #12908, so the exclusion loses its tracking issue when this lands. Open a follow-up issue to remove the entry and cite that number instead.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs