Repository navigation
test(chain): run each scenario as its own file on a stack of its own - #701
Merged
Merged
Conversation
Each file starts its own hub on its own database, so scenarios run at once and none counts another's runs. CI shards the files across five jobs, two files at a time in each.
Each test file calls it at its top level, so a file gets its own stack whether or not files share a module registry.
Contributor
Author
|
Independent review of 78510a6. No findings. What I checked:
How I verified it: oxlint on |
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.
The chain test's scenarios now run at the same time, each on a stack of its own, so CI waits for the slowest scenario instead of all of them in a row. This replaces #697, which closed when its base branch (#696) merged.
tests/chain/chain.test.tsis split into one file per scenario:deterministic,judged,waiting,pushed,held,woken,unwokenanddisconnected.tests/chain/chain.ts. Each file callschainStack()at its top level, which starts its own hub, database, fake GitHub and stub model for that file. A file gets its own stack however the files are run.after(), which made each scenario wait for the one before it so they could share one stack. Every test name and every assertion is the same as before (checked line by line), and the run still has the same 12 tests.bun run test:chainruns two files at a time. CI runs the chain in five jobs (--shard=k/5), two files per job.Times
Before, main run 40568541009: the chain step alone took 18m29s, and the whole
checkjob took 22m50s.After, run 40621672007 on this change before
chainStack(): 4m09s wall from first job start to last job end. The chain shards took 1m44s, 2m44s, 4m09s, 2m28s and 2m20s; the slowest holdsunwoken, which waits out the listener's two-minute key wait.Locally with
chainStack():bun run test:chainpassed all 12 tests, and a plainbun testof two chain files in one process passed both, each on its own stack.Overlap with #695
#695 edits
tests/chain/chain.test.ts, which this pull request splits. Whichever lands second moves its scenario edits into the matching per-scenario file, and #695's newrereadscenario becomes a file of its own.tests/chain/stack.tsis not touched here.The manager's and listener's production timers stay as they are, and scenarios keep a stack each.
Closes CL-11274