Repository navigation
test(autoCombo): warm task-fitness DB in beforeAll so first-call init can't time out (#15106) - #15253
Merged
diegosouzapw merged 2 commits intoOct 2, 2026
Conversation
… can't time out (diegosouzapw#15106) The first getTaskFitness() call in a worker pays the lazy, synchronous model-intelligence DB init (queryModelIntelligence). In autoCombo.test.ts ("Scoring > should calculate a score between 0 and 1") and tieredRotation.test.ts ("Connection Density Factor > multi-connection provider scores higher...") that call happens inside a pure-computation test, so under parallel load the init alone could exceed the 5s default. Add a top-level beforeAll warm-up with its own 30s budget to each file. No global testTimeout change. Locally the two tests drop from ~220ms to 1-2ms; 27 files / 261 tests pass. tieredRotation.test.ts was never Prettier-clean: Prettier collapses the comment that sat between the arguments of the "rotates across all 43 Cerebras connection IDs" it() call. Move that comment, text unchanged, above the call so the pre-commit formatter is stable; the remaining diff in that file is formatting. Closes diegosouzapw#15106
diegosouzapw
merged commit Oct 2, 2026
90a663e
into
diegosouzapw:release/v3.8.52
15 of 16 checks passed
Owner
|
Thanks @yourspraveen — merged into |
5 tasks done
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.
Closes #15106
Problem
Two AutoCombo Vitest tests time out at the 5 s default under parallel load, although both are pure computation:
open-sse/services/autoCombo/__tests__/autoCombo.test.ts:Scoring > should calculate a score between 0 and 1tests/unit/autoCombo/tieredRotation.test.ts:Connection Density Factor > multi-connection provider scores higher than single-connection at same qualityEach is the first test in its file to call
getTaskFitness(), and that first call pays the lazy, synchronous model-intelligence DB init (queryModelIntelligence,open-sse/services/autoCombo/taskFitness.ts).Fix
The scoped fix from the issue thread, with no global
testTimeoutchange:beforeAllthat callsgetTaskFitness()once, with its own 30 s budget. The init cost lands in the hook; the per-test 5 s budget measures only the test.Evidence
Measured with
--reporter=verbose(the mechanism; this machine is not loaded enough to cross 5 s):Scoring > should calculate a score between 0 and 1multi-connection provider scores higher…Neighbouring pure-computation tests in the same files take ~1 ms. The ~220 ms on an idle machine is the init that grew past 5 s on the reporter's loaded one.
npx vitest run --config vitest.mcp.config.ts tests/unit/autoCombo/ open-sse/services/autoCombo/ # Test Files 27 passed (27) | Tests 261 passed (261)Note on the formatting diff in
tieredRotation.test.tsThis file was never Prettier-clean. Prettier collapses (and on each run further scrambles) the 4-line comment that sat between the arguments of the
rotates across all 43 Cerebras connection IDsit()call. That would have happened via the pre-commit hook on any change to the file.60000timeout argument is untouched.Not changed:
maxWorkersinvitest.mcp.config.ts(raised on the issue as worth revisiting). That's a broader runner decision, so I left it for a separate change.Thanks @zerotraceio for the report and the careful re-measurement that pinned down the two tests.