From 2d206f992ca808349aaa74b0958aaa6bf0ebed58 Mon Sep 17 00:00:00 2001 From: johnjbarton Date: Mon, 13 Apr 2020 09:44:48 -0700 Subject: [PATCH 1/2] chore(deps): minor npm options changed --- package-lock.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0783b61ed..491bbe999 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3138,8 +3138,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true, - "optional": true + "dev": true }, "constants-browserify": { "version": "1.0.0", @@ -5565,8 +5564,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true, - "optional": true + "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", @@ -5595,7 +5593,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -8256,7 +8253,6 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" From e4a4dc0be6aa2942b7903daaeb06aebe14ad37a9 Mon Sep 17 00:00:00 2001 From: johnjbarton Date: Thu, 9 Apr 2020 16:01:02 -0700 Subject: [PATCH 2/2] fix(ci): stop the proxy before killing the child, handle errors 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 +++++++------ test/e2e/support/proxy.js | 8 ++++++++ 2 files changed, 15 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() + }) }) }) diff --git a/test/e2e/support/proxy.js b/test/e2e/support/proxy.js index 4a5757ca0..be18b770e 100644 --- a/test/e2e/support/proxy.js +++ b/test/e2e/support/proxy.js @@ -9,6 +9,10 @@ function Proxy () { target: 'http://localhost:9876' }) + self.proxy.on('error', function proxyError (err, req, res) { + console.log('support/proxy onerror', err) + }) + self.server = http.createServer(function (req, res) { const url = req.url const match = url.match(self.proxyPathRegExp) @@ -22,6 +26,10 @@ function Proxy () { } }) + self.server.on('clientError', (err, socket) => { + console.log('support/proxy clientError', err) + }) + self.start = function (port, proxyPath, callback) { self.proxyPathRegExp = new RegExp('^' + proxyPath + '(.*)') self.server.listen(port, function (error) {