fix: run-workers --by suite parallelization broken by test file sorting (4.x) by mirao · Pull Request #5438 · codeceptjs/CodeceptJS
4 tasks
…ng (codeceptjs#5412) The sorting of test files in loadTests() (added in codeceptjs#5386) broke the --by suite parallelization. When files were sorted before worker distribution, all workers could receive the same tests instead of different suites being distributed to different workers. Fix: Move testFiles.sort() from loadTests() to run(). This ensures: - Worker distribution uses original (unsorted) file order for consistent distribution across workers - Test execution still uses alphabetical order (sorted in run()) Added unit test to verify files are not sorted after loadTests(). Fixes codeceptjs#5412 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- alphabetical_order_test: avoid calling codecept.run() which hangs in CI due to container.started() and event listener setup; test loadTests() directly instead - worker_test: revert custom config assertions to original 4.x relaxed values (exact counts are filesystem-dependent) - worker_test: simplify distribution test to only verify suite distribution without assuming glob order Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The test depends on mocha.loadFiles() with full container globals (Feature, Scenario) which aren't available in unit test context on CI. The core fix (sort moved from loadTests to run) is already verified by alphabetical_order_test.js. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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