From 904a080ca85d194c206f36267db1d1f0b01fde00 Mon Sep 17 00:00:00 2001 From: johnjbarton Date: Thu, 9 Apr 2020 16:01:02 -0700 Subject: [PATCH] fix(ci): stop the proxy before killing the child This should fix #3464, hopefully. Since the test is flaky and only on Travis we can't be sure until we try for awhile. --- test/e2e/step_definitions/hooks.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/e2e/step_definitions/hooks.js b/test/e2e/step_definitions/hooks.js index 21a04481e..163c50025 100644 --- a/test/e2e/step_definitions/hooks.js +++ b/test/e2e/step_definitions/hooks.js @@ -4,12 +4,13 @@ cucumber.defineSupportCode((a) => { a.After(function (scenario, callback) { const running = this.child != null && typeof this.child.kill === 'function' - if (running) { - this.child.kill() - this.child = null - } - // stop the proxy if it was started - this.proxy.stop(callback) + this.proxy.stop(() => { + if (running) { + this.child.kill() + this.child = null + } + callback() + }) }) })