X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fpools%2Fselection-strategies%2Fworker-choice-strategy-context.test.js;h=46ac017c223687891b0eccd438892ea1a22f6c51;hb=6cdd998caa931ce15a2c59f7e616e0611573ec72;hp=5ffd66a384ec20decf6aee953e985886bc575a63;hpb=fa6f12966fa14931864dcd13596e080d689464b3;p=poolifier.git diff --git a/tests/pools/selection-strategies/worker-choice-strategy-context.test.js b/tests/pools/selection-strategies/worker-choice-strategy-context.test.js index 5ffd66a3..46ac017c 100644 --- a/tests/pools/selection-strategies/worker-choice-strategy-context.test.js +++ b/tests/pools/selection-strategies/worker-choice-strategy-context.test.js @@ -45,9 +45,9 @@ describe('Worker choice strategy context test suite', () => { sinon.restore() }) - after(() => { - fixedPool.destroy() - dynamicPool.destroy() + after(async () => { + await fixedPool.destroy() + await dynamicPool.destroy() }) it('Verify that execute() return the worker chosen by the strategy with fixed pool', () => { @@ -61,11 +61,11 @@ describe('Worker choice strategy context test suite', () => { } ) workerChoiceStrategyContext.workerChoiceStrategy = WorkerChoiceStrategyStub - const worker = workerChoiceStrategyContext.execute() + const chosenWorker = workerChoiceStrategyContext.execute() expect( - workerChoiceStrategyContext.workerChoiceStrategy.choose.calledOnce + workerChoiceStrategyContext.getWorkerChoiceStrategy().choose.calledOnce ).toBe(true) - expect(worker).toBe('worker') + expect(chosenWorker).toBe('worker') }) it('Verify that execute() return the worker chosen by the strategy with dynamic pool', () => { @@ -79,11 +79,11 @@ describe('Worker choice strategy context test suite', () => { } ) workerChoiceStrategyContext.workerChoiceStrategy = WorkerChoiceStrategyStub - const worker = workerChoiceStrategyContext.execute() + const chosenWorker = workerChoiceStrategyContext.execute() expect( - workerChoiceStrategyContext.workerChoiceStrategy.choose.calledOnce + workerChoiceStrategyContext.getWorkerChoiceStrategy().choose.calledOnce ).toBe(true) - expect(worker).toBe('worker') + expect(chosenWorker).toBe('worker') }) it('Verify that setWorkerChoiceStrategy() works with ROUND_ROBIN and fixed pool', () => {