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

Speed up four slow test files: route-marks, api-hints, here-pages, talk-phone #17364

opened this

Merged 40h 52m ago, live in production

Each of the four files is now split so no test is near the 2 s test budget, and talk-phone is no longer one 21 s file. There were no SLOW entries for these four in scripts/gate.ts, so I had none to delete. They were breaching the budgets themselves, as the issue #17359 report says.

Notes

opened this

Each of the four files is now split so no test is near the 2 s test budget, and talk-phone is no longer one 21 s file. There were no SLOW entries for these four in scripts/gate.ts, so I had none to delete. They were breaching the budgets themselves, as the issue #17359 report says. I ran bun x tsc --noEmit and the covering guard tests, and all pass. The forge's check runs the full suite.

  • route-marks, api-hints, here-pages:
    • The walk that called every route was one 2.4–3 s test in each file. It is now eight slices of the same routes, one test each.
    • Alone, the slowest slice is 0.6 s in route-marks and api-hints and 0.8 s in here-pages. The old tests ran 2.4 s, 2.8 s and 3 s under load.
    • api-hints keeps the provoked-status checks (401, 403, 404, 409, 422) as their own test. They still assert every status was exercised.
    • here-pages keeps its kind-set assertions in a test after the slices, and warms /, the site image and the sitemap in beforeAll. The first request paid a cold-start cost that landed in one slice.
  • talk-phone:
    • The fixture, the phone() helper and the per-width browser tests moved to test/helpers/talk-phone.ts, with widthTests(width) exported.
    • talk-phone-360, -375 and -390 each run one width. talk-phone.test.ts keeps the non-browser tests and the two reply/answering tests.
    • There is no Chromium in this sandbox, so the browser tests skipped here. I could not time the new files; the forge's check will.
  • Guard tests you named: unused-exports, module-state, test-honesty and the other scan tests pass. The helper's exports all have callers, and no module-level Map, Set or array is added.

I did not add a docs/features/ or src/tui/ change, since this touches tests only (the commit says "No door"). I wrote no new function, so I did not run similar.ts. gate.ts --fix leaves a note about comment lines over 100 columns in three test files; the nightly rewrap handles them.

To try it: bun test test/route-marks.test.ts test/api-hints.test.ts test/here-pages.test.ts test/talk-phone*.test.ts.

Closes #17361

commented

Each of the four files is now split so no test is near the 2 s test budget, and talk-phone is no longer one 21 s file. There were no SLOW entries for these four in scripts/gate.ts, so I had none to delete. They were breaching the budgets themselves, as the issue #17359 report says. I ran bun x tsc --noEmit and the covering guard tests, and all pass. The forge's check runs the full suite.

  • route-marks, api-hints, here-pages:
    • The walk that called every route was one 2.4–3 s test in each file. It is now eight slices of the same routes, one test each.
    • Alone, the slowest slice is 0.6 s in route-marks and api-hints and 0.8 s in here-pages. The old tests ran 2.4 s, 2.8 s and 3 s under load.
    • api-hints keeps the provoked-status checks (401, 403, 404, 409, 422) as their own test. They still assert every status was exercised.
    • here-pages keeps its kind-set assertions in a test after the slices, and warms /, the site image and the sitemap in beforeAll. The first request paid a cold-start cost that landed in one slice.
  • talk-phone:
    • The fixture, the phone() helper and the per-width browser tests moved to test/helpers/talk-phone.ts, with widthTests(width) exported.
    • talk-phone-360, -375 and -390 each run one width. talk-phone.test.ts keeps the non-browser tests and the two reply/answering tests.
    • There is no Chromium in this sandbox, so the browser tests skipped here. I could not time the new files; the forge's check will.
  • Guard tests you named: unused-exports, module-state, test-honesty and the other scan tests pass. The helper's exports all have callers, and no module-level Map, Set or array is added.

I did not add a docs/features/ or src/tui/ change, since this touches tests only (the commit says "No door"). I wrote no new function, so I did not run similar.ts. gate.ts --fix leaves a note about comment lines over 100 columns in three test files; the nightly rewrap handles them.

To try it: bun test test/route-marks.test.ts test/api-hints.test.ts test/here-pages.test.ts test/talk-phone*.test.ts.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs