Run slow test suites in parallel#26523
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request enables parallel test execution for two of the slowest test suites in the repository to improve CI performance. The changes configure Mocha to run tests in parallel mode with 4 worker processes for both the end-to-end tests and the merge-tree DDS tests.
Changes:
- Enable parallel test execution with 4 jobs for the end-to-end test suite
- Enable parallel test execution with 4 jobs for the merge-tree test suite
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/test/test-end-to-end-tests/src/test/.mocharc.cjs | Adds parallel execution configuration with 4 jobs to the end-to-end test suite |
| packages/dds/merge-tree/.mocharc.cjs | Adds parallel execution configuration with 4 jobs to the merge-tree test suite |
| config.parallel = true; | ||
| config.jobs = 4; |
There was a problem hiding this comment.
Enabling parallel mode for tests that already require the exit flag (line 14) due to cleanup issues may lead to unexpected behavior. The exit flag indicates tests don't clean up properly, which could cause issues when running in parallel workers. Consider testing thoroughly to ensure parallel execution doesn't exacerbate existing cleanup problems or cause test flakiness. In Mocha's parallel mode, each test file runs in a separate worker process, which may help isolate issues but could also mask cleanup problems that would affect subsequent tests in serial execution.
| config.parallel = true; | |
| config.jobs = 4; | |
| // Do not enable Mocha parallel mode here: this suite currently requires --exit due to cleanup issues, | |
| // and tests are known to leak memory. Running in parallel could hide or exacerbate these problems. |
Description
Make the two slowest test suites run tests in parallel for faster CI times.
Since these two suites take much longer than the others, splitting them up for aprallel running should better utalize the CPU time on CI after the other test suites have finished.
The job count is kept somehat low (at 4) since to avoid way too many processes and memory use when CI runs multiple suites in parallel.
Local testing showed:
For merge-tree:
real 7m6.237s
user 9m21.428s
sys 0m7.807s
to
real 2m47.996s
user 9m43.899s
sys 0m4.306s
For end-to-end:
real 8m8.765s
user 4m21.356s
sys 0m17.529s
to
real 2m3.571s
user 6m21.392s
sys 0m42.993s
Reviewer Guidance
The review process is outlined on this wiki page.