test(client): accelerate service lifecycle tests - #41879
Merged
Merged
Conversation
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.
What
Reduce Client service lifecycle test time by exercising the same polling, probe, contender, backoff, eviction, and stop behavior with an accelerated private timing policy.
The focused lifecycle suite improves from 72.556s to a 4.529s median, saving 68.03s (93.8%) per run.
How
WeakMap; publicEnsureOptionsand package exports are unchanged.Scope
This does not replace subprocesses, mock lifecycle operations, reduce retry counts, or alter production service timing. The private timing module is compiled into
distbut is not exposed through package exports or public service declarations.Testing
hyperfine --warmup 1 --runs 3 'bun run test test/service.test.ts test/promise-service.test.ts': 72.556s ± 0.031shyperfine --warmup 1 --runs 9 'bun run test test/service.test.ts test/promise-service.test.ts': 4.529s median, 4.468s–5.253sbun run test test/service.test.ts test/promise-service.test.ts --rerun-each 10: 190 passbun run test: 52 passbun typecheckbun run buildgit diff --check