Skip to content

Commit c8cad75

Browse files
committed
fixed an startup issue for when tests are running in parallel
1 parent c998ac3 commit c8cad75

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

lib/settings/settings.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ class Settings {
330330
this.settings.test_workers.workers = this.argv.workers || this.settings.test_workers.workers;
331331
}
332332

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

335335
return this;
336336
}

test/src/runner/testRunTestsuite.js

+22
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,26 @@ describe('testRunTestSuite', function () {
280280
test_workers: true
281281
}));
282282
});
283+
284+
it('test worker mode and single test source', function () {
285+
let testsPath = path.join(__dirname, '../../sampletests/withdescribe/failures/sampleSkipTestcases.js');
286+
let globals = {
287+
calls: 0,
288+
retryAssertionTimeout: 0,
289+
reporter(results, cb) {
290+
assert.strictEqual(this.settings.testWorkersEnabled, true);
291+
cb();
292+
}
293+
};
294+
295+
return runTests({
296+
_source: [testsPath],
297+
'test-worker': true
298+
}, settings({
299+
globals,
300+
output: false,
301+
test_workers: true
302+
}));
303+
});
304+
283305
});

0 commit comments

Comments
 (0)