Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: stream.finished detects a destroyed IncomingMessage
Add a test to verify that stream.finished works correctly
on IncomingMessage

refs: #38657
  • Loading branch information
Linkgoron committed May 12, 2021
commit c9bc54d47a0c882b8c3961b1cbe6602f970bad1c
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() {
Comment thread
Linkgoron marked this conversation as resolved.
Outdated
http.request({
method: 'GET',
port: this.address().port
}).end().on('error', common.mustCall());
});
}


{
const w = new Writable({
Expand Down