Skip to content

Commit

Permalink
test: stream.finished detects a destroyed IncomingMessage
Browse files Browse the repository at this point in the history
Add a test to verify that stream.finished works correctly
on IncomingMessage

refs: nodejs#38657
  • Loading branch information
Linkgoron committed May 12, 2021
1 parent 7c8a608 commit c9bc54d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/parallel/test-stream-finished.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,22 @@ testClosed((opts) => new Writable({ write() {}, ...opts }));
});
}

{
const server = http.createServer((req, res) => {
req.on('close', () => {
finished(req, common.mustCall(() => {
server.close();
}));
});
req.destroy();
}).listen(0, function() {
http.request({
method: 'GET',
port: this.address().port
}).end().on('error', common.mustCall());
});
}


{
const w = new Writable({
Expand Down

0 comments on commit c9bc54d

Please sign in to comment.