Conversation
Tests matching the new `serial` config pattern are kept out of the parallel workers. Once those exit, one more worker starts and runs the serial tests one by one, inside the same run: bootstrapAll, teardownAll and workers.result fire once and the exit code covers both parts. Works with every --by strategy and combines with --grep. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been 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.
Problem
Some tests mutate global state and can't run next to anything else. Today the only way to handle them with workers is two commands:
That means two processes, so CI needs shell to combine exit codes,
bootstrapAll/teardownAlldon't wrap the second command, and any reporter listening onevent.workers.*sees two separate runs that have to be merged afterwards.Change
New
serialconfig key:run-workerskeeps matching tests out of the parallel workers. When those exit, one more worker starts and runs the serial tests one by one.bootstrapAll,teardownAll,event.workers.before/after/resultfire once; the exit code covers both parts.--grep, so a tag on aFeatureor added with.tag()works.--by test,suiteandpool. Pool workers receive whole files, so they get the serial test ids and drop them after loading a file.--grep: only serial tests that also match are run; if none match, no serial worker starts; if only serial tests match, no parallel worker starts.Design choices
-ooverrides are applied in workers only, so they don't reach the main process where tests are split.--bystrategies and it gets its ownbootstrap/teardown.reload) to collect serial tests, only whenserialis set.Limits
multiplebrowser profiles each profile gets its own serial worker, started one after another. I did not run this path — the sandbox has no fixture for it.--by suite, a Feature holding both serial and parallel scenarios is split, so itsBeforeSuiteruns in both workers. Tagging the Feature keeps it whole.spawn()/addTests()themselves are unaffected; the lane only applies to the built-in split.Tests
New fixture
test/data/sandbox/workers-serialrecords start/end of each test to a timeline file;run_workers_test.jsasserts serial tests come last and don't overlap, for each--bystrategy and with--grep.test/runner/run_workers_test.js+test/unit/worker_test.js: 51 passing, 2 pending locally.🤖 Generated with Claude Code