From 0fc3a2de71891faded9781e6d098ab48331499fa Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Thu, 27 Apr 2023 16:24:28 -0700 Subject: [PATCH] Parallel: take care of pending specs --- spec/command_spec.js | 4 ---- spec/parallel_runner_spec.js | 3 --- spec/parallel_worker_spec.js | 29 +++++++++++++++++++++++++---- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/spec/command_spec.js b/spec/command_spec.js index a615216..5193738 100644 --- a/spec/command_spec.js +++ b/spec/command_spec.js @@ -502,10 +502,6 @@ describe('command', function() { }); sharedRunBehavior('--parallel=2'); - - it('does not allow the random seed to be set'); - - it('does not allow randomization to be disabled'); }); }); diff --git a/spec/parallel_runner_spec.js b/spec/parallel_runner_spec.js index 84642b8..3bd07af 100644 --- a/spec/parallel_runner_spec.js +++ b/spec/parallel_runner_spec.js @@ -370,9 +370,6 @@ describe('ParallelRunner', function() { }); }); - it('handles worker crashes'); - it('handles worker exec failures'); - it('dispatches a jasmineStarted event at the start of execution', async function () { this.testJasmine.numWorkers = 2; this.testJasmine.loadConfig({ diff --git a/spec/parallel_worker_spec.js b/spec/parallel_worker_spec.js index a8fae2b..4db16da 100644 --- a/spec/parallel_worker_spec.js +++ b/spec/parallel_worker_spec.js @@ -93,7 +93,31 @@ describe('ParallelWorker', function() { expect(core.boot).toHaveBeenCalledWith(jasmine.is(core)); }); - it('does something reasonable when the core module fails to load'); + it('sends a fatalError message when the core module fails to load', async function() { + const error = new Error('core loading failed'); + const loader = { + load() { + return Promise.reject(error); + } + }; + new ParallelWorker({loader, clusterWorker: this.clusterWorker}); + + this.clusterWorker.emit('message', { + type: 'configure', + configuration: {} + }); + await new Promise(res => setTimeout(res)); + + expect(this.clusterWorker.send).toHaveBeenCalledWith( + { + type: 'fatalError', + error: { + message: error.message, + stack: error.stack + }, + } + ); + }); it('creates and configures an env', async function() { const env = jasmine.createSpyObj('env', [ @@ -555,9 +579,6 @@ describe('ParallelWorker', function() { }); } }); - - - it('exits on disconnect'); }); function dispatchRepoterEvent(env, eventName, payload) {