Skip to content

fix(workers): create output directory of each run in run-workers - #5809

Open
mirao wants to merge 1 commit into
codeceptjs:4.xfrom
mirao:fix/run-workers-output-dir-5807
Open

mirao wants to merge 1 commit into
codeceptjs:4.xfrom
mirao:fix/run-workers-output-dir-5807

Conversation

@mirao

@mirao mirao commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #5807

Problem

With a multiple config, run-workers N <run> sets each worker's output to <output>/<run>_<browser>N, but it creates only the root output/ folder. A test that writes into output_dir before a plugin creates the folder fails with ENOENT. run-multiple doesn't have this problem, because each child process creates its own output folder through run.

Changes

  • lib/workers.js: createWorkerObjects() now calls mkdirp.sync() on each worker's runOutputDir right after computing it.
  • test/runner/run_workers_test.js:
    • New test, should create output directory of each run in multi-run. It uses a new sandbox config without plugins (codecept.workers-multiple-output.conf.js), so nothing else creates the folders. It fails without the fix.
    • The should create output folder with custom name test now removes thisIsCustomOutputFolderName/ after the check. It used to stay behind in test/data/sandbox as an untracked folder.

Tests

  • The repro from the issue now passes, and data.txt is written into both default_chromium1/ and default_webkit1/.
  • npx mocha test/runner/run_workers_test.js: 43 passing.
  • npx mocha test/unit/worker_test.js: 13 passing, 2 pending.

🤖 Generated with Claude Code

…eceptjs#5807)

With a `multiple` config, run-workers set each worker's output to
<output>/<run>_<browser>N but never created it, so tests writing into
output_dir failed with ENOENT unless a plugin created the folder first.

Also remove the folder left behind by the custom output folder name test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

run-workers with a multiple config doesn't create each worker's output directory (ENOENT when writing to output_dir)

1 participant