Skip to content

Commit

Permalink
test: fix flaky http-writable-true-after-close
Browse files Browse the repository at this point in the history
  • Loading branch information
apapirovski committed Jan 3, 2018
1 parent 54062d3 commit 673544e
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 673544e

Please sign in to comment.