test(mothership): keep the preview turn-budget test fast under load - #8458
Merged
Merged
Conversation
…r CPU load The four-patch turn-budget test drove 2,400 deltas over a ~300 KB base, about 2.4 s of CPU on an idle machine and 11-15 s at load 150, past the 10 s test timeout. Pacing already runs on fake timers; the flake was CPU time, not wall clock. Four 30 s patches at a 500 ms tick still stream ~25 MB uncapped against the 8 MiB budget, so the test still fails when the cap is removed.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
|
This branch was previously deployed
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.
Summary
"bounds all preview content in a turn of four long patches, and still completes each" in
file-preview-adapter.test.tstimed out under CPU load. It passes alone, but hit 3 failures in 10 runs with extra CPU-bound processes, at 11–15 s against the 10 s test timeout.The pacing was already deterministic: the test uses fake timers, and the adapter's only clock is
Date.now(). The cost was CPU. The test sent 2,400 deltas against a file of about 300 KB, and the adapter rebuilds the preview text and persists the session on every delta, so the test took about 2.4 s of CPU on an idle machine.The test now streams four 30 s patches at a 500 ms tick: 240 deltas, about 265 ms idle. That still exceeds the per-turn preview budget, and the assertion is unchanged. With the adapter's turn-budget check removed, the test still fails.
Testing
bun run lint,bun run type-checkandbun run check:auditspass.