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

Full suite red: test/tui-hooks.test.ts #12858

Merged opened this in answer to

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

Merged

test/tui-hooks.test.ts had one test that opened three terminal sessions in a row, and it took 2.72 s against the 2 s test budget. I split it into three tests, one per field: url, kinds and secret over their length. Each new test keeps the assertions the old one had.

Notes

shipped production is serving it deploy 5bb6da3

opened this

test/tui-hooks.test.ts had one test that opened three terminal sessions in a row, and it took 2.72 s against the 2 s test budget. I split it into three tests, one per field: url, kinds and secret over their length.

Each new test keeps the assertions the old one had. The url and kinds tests now also check that no webhook was added, and the secret test still checks that the secret is never echoed. No production code changed.

The file passes locally (12 tests) and bun x tsc --noEmit is clean. I didn't get per-test timings from a local run, so I haven't confirmed each new test is under 2 s. The forge's check on this push will show that. I didn't run scripts/gate.ts, and the change doesn't touch src/web/, so I skipped the design lint.

To try it: bun test ./test/tui-hooks.test.ts --rerun-each 10.

Closes #12837

commented

test/tui-hooks.test.ts had one test that opened three terminal sessions in a row, and it took 2.72 s against the 2 s test budget. I split it into three tests, one per field: url, kinds and secret over their length.

Each new test keeps the assertions the old one had. The url and kinds tests now also check that no webhook was added, and the secret test still checks that the secret is never echoed. No production code changed.

The file passes locally (12 tests) and bun x tsc --noEmit is clean. I didn't get per-test timings from a local run, so I haven't confirmed each new test is under 2 s. The forge's check on this push will show that. I didn't run scripts/gate.ts, and the change doesn't touch src/web/, so I skipped the design lint.

To try it: bun test ./test/tui-hooks.test.ts --rerun-each 10.

commented

This fixes test/tui-hooks.test.ts going over the 2 s test budget; it's a test-only change. The file now runs in 3.8 s locally, down from 13 s. All 12 tests pass and bun x tsc --noEmit is clean. I haven't run it under the forge's sharded check, so that is the real confirmation.

Splitting the over-length test in my first push wasn't enough, because the failing check log shows two more tests in the file over budget (the add/remove one at 2.59 s, the pause one at 2.30 s). Every test in the file was slow for the same reason: the test's feed helper waited for the terminal to settle after each typed character, and typing a 29-character secret cost about a second.

feed in test/tui-hooks.test.ts now sends runs of plain characters in one burst and settles once. Enter and the arrow key still go one at a time. The split into three tests from the first push stays.

The same check log also shows a failure in the memory sampler test (shard 3, the memory sampler reads the heap's size without walking the heap) and two other files over budget (test/schema-migrations.test.ts, test/billing-never-deletes.test.ts). I didn't touch them; they aren't part of this issue.

Approved

Test-only change that serves the per-test time budget (#1242): feed settles once per run of plain characters instead of once per character, and the over-length test is split into one test per field, each keeping its old assertions plus a no-webhook-added check. No production code, no src/web, no dependency, no README change; nothing user-facing to preview. Two things I would do next: (1) in feed, k in KEYS also matches inherited names such as "constructor" if KEYS is a plain object, so use Object.hasOwn(KEYS, k); (2) confirm the per-test timings on the forge check and move the other over-budget files named in the pull (schema-migrations, billing-never-deletes) and the memory sampler failure to their own issues.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs