Skip to content

Commit

Permalink
test: reach res._dump after abort ClientRequest
Browse files Browse the repository at this point in the history
PR-URL: #24191
Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
tadhgcreedon authored and BethGriggs committed Feb 12, 2019
1 parent eaa5e3e commit 06208c8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/parallel/test-http-client-abort-response-event.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';
const common = require('../common');
const http = require('http');
const net = require('net');
const server = http.createServer(function(req, res) {
res.end();
});

server.listen(0, common.mustCall(function() {
const req = http.request({
port: this.address().port
}, common.mustCall());

req.on('abort', common.mustCall(function() {
server.close();
}));

req.end();
req.abort();

req.emit('response', new http.IncomingMessage(new net.Socket()));
}));

0 comments on commit 06208c8

Please sign in to comment.