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 <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
tadhgcreedon authored and targos committed Nov 29, 2018
1 parent 97b803f commit e96c60e
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 e96c60e

Please sign in to comment.