Repository navigation
test: delete the redraw wall-time race and shrink oversized scaling populations (~105 s per run) - #37385
Conversation
…opulations Deletes terminal-tail-redraw-wall-time: its result equality duplicates the randomized equivalence suite and its complexity claim is pinned by the join-counting scaling suite; it only added a 3x wall-clock race. Shrinks scaling suites whose bounds are exact or log-bounded formulas in n to the smallest population that still separates linear from superlinear work, and pairs a worktree-poll test's scans so it no longer waits out the 5 s scan timeout.
|
| const freshPolling = runtime.getWorktreePs() | ||
| staleScan.resolve(MOCK_GIT_WORKTREES) |
There was a problem hiding this comment.
Wait for the fresh scan to start before resolving staleScan.
runtime.getWorktreePs() can yield before the underlying listWorktrees call. The test resolves staleScan immediately after starting freshPolling, so it does not prove that the fresh scan started while the stale scan was pending. A sequential implementation can still reach two total calls and satisfy the new assertion. Add a start barrier for both scans, then resolve staleScan after the second scan call is observed. (raw.githubusercontent.com)
This is a skeptical pass over the most expensive unit test files from green main run 41400829349. It deletes one suite, shrinks five scaling suites, and fixes one test that was waiting out a real 5 s timeout. Measured savings: about 105 worker-seconds per full unit run. For the changed files, CI test time went from 127.5 s on main (41400829349) to 64.4 s on this PR (41403569437). The deleted suite accounts for another 41.6 s, including its imports.
For every file I asked four questions: would deleting it let a real bug ship, is the behavior already covered more cheaply, is it testing timing rather than behavior, and is N larger than needed to catch the regression.
Changed
src/main/runtime/terminal-tail-redraw-wall-time.test.tsterminal-tail-redraw-row.equivalence(2,000 randomized streams against the same per-character reference). The #11315 complexity claim is already pinned deterministically byterminal-tail-redraw-scaling(it counts wide-row joins). What remains is a 3x wall-clock race, which is an anti-pattern: it waits on real time and duplicates coveragestructured-agent-session-input-order-projection.test.tsacp-history-scaling.test.ts(two slowest cases)journal-checkpoint-scaling.test.tschat-worker-legacy-failure-read.test.ts3 * n,5 * n, and so on). 300 still crosses the 128-row and 200-row journal page sizesjournal-input-legacy-baseline.test.tsorca-runtime"keeps each worktree poll paired with its platform generation"RESOLVED_WORKTREE_REPO_TIMEOUT_MS(5 s) and fell back to stored rows. They now run concurrently, and the test asserts that both generations really scannedFor the deleted suite, the entries in
vitest-node-runtime-files.mjs,config/flaky-test-pattern-baseline.txtandci-shard-timings.jsonare removed.Kept (each has a concrete bug it catches that nothing cheaper does)
codex-interrupt-order,codex-goal-stop-settings,codex-stopped-send-order,codex-turn-end-settlement)turn/completednever shows a transient failed turn. The 5 s isCODEX_STOP_GRACE_MS, which is inherent to that ordering; avoiding it would need a test-only production seamaccount-add-processremote-node-runtime-host-downloadtimeoutcommand (#35869). The 30 s is the production minimum attemptserver-claude-helper-recovery/-killwsl-distro-holder-script/procscanning, fail-closed cases)serialize-grid-transcript-replaypty-connection-*,launch-parity-window-tab,orca-runtime(other cases)codex-shell-no-daemon, codex app-server teardown/supervision/clientjournal-outcome-scalingMAX_JOURNAL_LIFECYCLE_BATCH_MUTATIONS(200). Shrinking it would drop that boundaryremote-runtime-request-connectionuse-ai.operation-recoveryorchestration-cli-restart-handoffpr-unit-support-routingbeforeAll. It is the only check that product code never imports test harnesses (leaving CI scoping alone)Checks
pnpm teston all touched suites, plus the redraw scaling/equivalence suites and the config suites that readvitest-node-runtime-files.mjs: 1,520 passed (orca-runtimere-run after one assertion fix).oxlintandoxfmton the changed files: clean.pnpm check:flaky-test-pattern-ratchet: OK (3,325 findings, baseline entry removed).