Skip to content

fix(workers): skip loadTests in run() when suite is already populated - #5721

Merged
DenysKuchma merged 3 commits into
codeceptjs:4.xfrom
danikkrapivnitskiy:fix/workers-skip-reload-when-suite-loaded
Sep 29, 2026
Merged

DenysKuchma merged 3 commits into
codeceptjs:4.xfrom
danikkrapivnitskiy:fix/workers-skip-reload-when-suite-loaded

Conversation

@danikkrapivnitskiy

Copy link
Copy Markdown
Contributor

Summary

Tests

  • test/unit/worker_test.js: one worker + grep → expect stats.tests === 1 (JS worker file).
  • Gherkin sandbox (codecept.workers-gherkin.conf.js, workers-gherkin/single.feature) with the same assertion.

Test plan

  • npx mocha test/unit/worker_test.js --grep "should run each assigned"

Made with Cursor

Worker threads call loadTests() in filterTests() before codecept.run().
A second loadTests() in run() duplicated Gherkin suites and executed each
assigned test twice (regression since ESM loadTests in codeceptjs#5640).

Add regression tests for JS and Gherkin worker assignments.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@danikkrapivnitskiy

Copy link
Copy Markdown
Contributor Author

@DenysKuchma seems like tests should be updated. Can I merge with failed pipeline or should I wait for fix?

@DenysKuchma

Copy link
Copy Markdown
Collaborator

Hi, @danikkrapivnitskiy thanks a lot for your PR
I’ve updated the tests; pull the changes, and all the tests should pass

@DenysKuchma
DenysKuchma merged commit ff47c22 into codeceptjs:4.x Sep 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants