Repository navigation
test(cli): speed up managed service tests - #53441
Merged
Merged
Conversation
kitlangton
force-pushed
the
faster-service-tests
branch
from
October 5, 2026 22:31
d312a58 to
77b6b37
Compare
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
The CLI's managed-service tests spawn real
serve --serviceprocesses and are among the slowest in the CLI suite. Much of that time is avoidable test overhead: every spawned process transpiles the CLI from a cold cache, and three tests wait out a server's real 5 s registration check to prove decision logic that doesn't need a real process.What Changes
Test-only. No production code changes.
XDG_CACHE_HOME, which also moved Bun's transpiler cache into it, so every spawned CLI process started cold.isolatedEnvandserviceEnvnow pointBUN_RUNTIME_TRANSPILER_CACHE_PATHat one shared directory.ServiceRegistration.registerin-process underTestClock, instead of starting a real server and waiting 5 s. The real-process test for a server whose boot failed stays, because it proves the failed server is still watching its registration.service-lifecycle.test.tsalso still shows a real server exiting after its registration is corrupted.service.test.tsrepeated the case inservice-lifecycle.test.ts. That case now also asserts the exact conflict message, theopencode service set port <port>hint, and that no registration was written.Unchanged on purpose: the 8 s wait in the bind-race incumbent test, which must exceed the earlier 6 s incumbent window, and the server's 15 s bind-recovery window that the occupied-port cases wait out.
Verification
service.test.ts21/21 andservice-lifecycle.test.ts7/7.v2to 196 s.service.test.tsalone went from 114 s to 70 s.