Skip to content

Commit

Permalink
fixed an startup issue for when tests are running in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Jan 10, 2023
1 parent c998ac3 commit c8cad75
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ class Settings {
this.settings.test_workers.workers = this.argv.workers || this.settings.test_workers.workers;
}

this.settings.testWorkersEnabled = this.testWorkersEnabled && !singleSourceFile(this.argv);
this.settings.testWorkersEnabled = this.testWorkersEnabled && (!singleSourceFile(this.argv) || this.argv['test-worker'] === true);

return this;
}
Expand Down
22 changes: 22 additions & 0 deletions test/src/runner/testRunTestsuite.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,26 @@ describe('testRunTestSuite', function () {
test_workers: true
}));
});

it('test worker mode and single test source', function () {
let testsPath = path.join(__dirname, '../../sampletests/withdescribe/failures/sampleSkipTestcases.js');
let globals = {
calls: 0,
retryAssertionTimeout: 0,
reporter(results, cb) {
assert.strictEqual(this.settings.testWorkersEnabled, true);
cb();
}
};

return runTests({
_source: [testsPath],
'test-worker': true
}, settings({
globals,
output: false,
test_workers: true
}));
});

});

0 comments on commit c8cad75

Please sign in to comment.