Repository navigation
[2026-11-15t02-00-02-912z] slow-test-optimizer - #424
Merged
Merged
Conversation
Contributor
Author
Artifacts & verificationRun: 370 · Commit: Verification reportProduced by Show artifactAuto-review summaryProduced by Show artifact |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Task 2026-11-15t02-00-02-912z: slow-test-optimizer
The suite is mostly fast. The slowest tests are either deliberate real-time tests or sequential process spawns.
should reject removed worker flagsinpackages/code/tests/cli.test.tsspawned six independentbunCLI processes one after another, so it paid process startup six times in sequence. That cost is fixable without changing what the test checks.What changed
In
packages/code/tests/cli.test.ts, the sixrunCLI(["worker", flag])calls now run withPromise.all. The assertions are identical: stderr contains<flag> has been removed from devintern worker, and exit code is 1, checked per flag. No other file changed.Slowest tests measured (JUnit, full-suite run):
runCLI timeout diagnostic– escalates to SIGKILL (tests/markdown-file.test.ts)tests/default-branch-detection.test.ts)--auto-review-iterationsrunInteractiveMode– waitForEditspawnAgentoutput sink – multi-byte character split across chunksBefore and after for the target:
cli.test.ts).Scope
Included: the one test above. Excluded: all other slow tests. The SIGKILL and git-timeout tests are slow because they assert real timing, so they were left alone. The other CLI-spawn tests were not touched.
packages/pmandpackages/agent-harnesshave nothing near worth optimizing.Tradeoffs
Six
bunprocesses now start at once instead of one at a time. That means a brief CPU spike, and in principle more exposure to load-induced slowness. The file's default timeout is 30s, so there's a lot of margin. EachrunCLIcall uses its own temp directory, so there's no shared state between the parallel runs. I did not change any timeouts.Blast Radius
Only this test body changed. No source code, helpers, or other tests were affected. The remaining risk is flakiness from parallel spawns under heavy load; this didn't show up in the runs below.
Verification
bun run tests/run-tests.ts cli.test.ts10 times after the change. All 10 exited 0 with 52 pass and 0 fail.bun run testinpackages/code. 2931 pass, 0 fail, 186 files.bun run format:checkpasses.bun run typecheckprinted no errors.oxlintwas run on the file but it only printed "No config found, using defaults" and its result was not otherwise examined. I did not run the repo's configured lint (bun run lint).bun testinpackages/coderefuses to run, becausetests/run-tests.tsmust setGIT_CEILING_DIRECTORIES. I usedbun run tests/run-tests.tsfor all package-code measurements.packages/pmandpackages/agent-harnesswere measured once each and not re-run.This PR was automatically created by @devintern/code