From dec917f0704d38d1f932c585a3b6d6c2b15aab72 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Wed, 3 Jan 2018 11:57:23 -0500 Subject: [PATCH] test: fix flaky http-writable-true-after-close PR-URL: https://github.com/nodejs/node/pull/17952 Fixes: https://github.com/nodejs/node/issues/16321 Reviewed-By: Luigi Pinca Reviewed-By: Matteo Collina Reviewed-By: Ruben Bridgewater --- .../test-http-writable-true-after-close.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename test/{sequential => parallel}/test-http-writable-true-after-close.js (78%) diff --git a/test/sequential/test-http-writable-true-after-close.js b/test/parallel/test-http-writable-true-after-close.js similarity index 78% rename from test/sequential/test-http-writable-true-after-close.js rename to test/parallel/test-http-writable-true-after-close.js index d0972673fb95e7..a1915dd69c5da8 100644 --- a/test/sequential/test-http-writable-true-after-close.js +++ b/test/parallel/test-http-writable-true-after-close.js @@ -12,16 +12,16 @@ let external; // Proxy server const server = createServer(common.mustCall((req, res) => { - get(`http://127.0.0.1:${internal.address().port}`, common.mustCall((inner) => { - const listener = common.mustCall(() => { - assert.strictEqual(res.writable, true); - }); + const listener = common.mustCall(() => { + assert.strictEqual(res.writable, true); + }); - // on CentOS 5, 'finish' is emitted - res.on('finish', listener); - // everywhere else, 'close' is emitted - res.on('close', listener); + // on CentOS 5, 'finish' is emitted + res.on('finish', listener); + // everywhere else, 'close' is emitted + res.on('close', listener); + get(`http://127.0.0.1:${internal.address().port}`, common.mustCall((inner) => { inner.pipe(res); })); })).listen(0, () => {