From daf4e1a91fd511431a4526eb7c01ee5e579d0322 Mon Sep 17 00:00:00 2001 From: Kim Joar Bekkelund Date: Wed, 11 Apr 2018 14:35:41 +0200 Subject: [PATCH] Always inject 'log' into worker (#17653) --- src/cli/cluster/worker.test.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cli/cluster/worker.test.js b/src/cli/cluster/worker.test.js index ec876786995a..61a5b51909b1 100644 --- a/src/cli/cluster/worker.test.js +++ b/src/cli/cluster/worker.test.js @@ -22,6 +22,7 @@ function assertListenerRemoved(emitter, event) { function setup(opts = {}) { const worker = new Worker({ + log: new Log(false, true), ...opts, baseArgv: [] }); @@ -70,7 +71,7 @@ describe('CLI cluster manager', function () { describe('#shutdown', function () { describe('after starting()', function () { it('kills the worker and unbinds from message, online, and disconnect events', async function () { - const worker = setup({ log: new Log(false, true) }); + const worker = setup(); await worker.start(); expect(worker).toHaveProperty('online', true); const fork = worker.fork; @@ -97,7 +98,7 @@ describe('CLI cluster manager', function () { describe('#parseIncomingMessage()', function () { describe('on a started worker', function () { it(`is bound to fork's message event`, async function () { - const worker = setup({ log: new Log(false, true) }); + const worker = setup(); await worker.start(); sinon.assert.calledWith(worker.fork.on, 'message'); }); @@ -159,7 +160,7 @@ describe('CLI cluster manager', function () { describe('when not started', function () { // TODO This test is flaky, see https://github.com/elastic/kibana/issues/15888 it.skip('creates a fork and waits for it to come online', async function () { - const worker = setup({ log: new Log(false, true) }); + const worker = setup(); sinon.spy(worker, 'on'); @@ -171,7 +172,7 @@ describe('CLI cluster manager', function () { // TODO This test is flaky, see https://github.com/elastic/kibana/issues/15888 it.skip('listens for cluster and process "exit" events', async function () { - const worker = setup({ log: new Log(false, true) }); + const worker = setup(); sinon.spy(process, 'on'); sinon.spy(cluster, 'on');