Skip to content

Commit

Permalink
test: fix flaky http-writable-true-after-close
Browse files Browse the repository at this point in the history
PR-URL: #17952
Fixes: #16321
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
apapirovski authored and MylesBorins committed Jan 9, 2018
1 parent 591dd4e commit 7998058
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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, () => {
Expand Down

0 comments on commit 7998058

Please sign in to comment.