Skip to content

Commit e96c60e

Browse files
tadhgcreedontargos
authored andcommitted
test: reach res._dump after abort ClientRequest
PR-URL: #24191 Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 97b803f commit e96c60e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
const common = require('../common');
3+
const http = require('http');
4+
const net = require('net');
5+
const server = http.createServer(function(req, res) {
6+
res.end();
7+
});
8+
9+
server.listen(0, common.mustCall(function() {
10+
const req = http.request({
11+
port: this.address().port
12+
}, common.mustCall());
13+
14+
req.on('abort', common.mustCall(function() {
15+
server.close();
16+
}));
17+
18+
req.end();
19+
req.abort();
20+
21+
req.emit('response', new http.IncomingMessage(new net.Socket()));
22+
}));

0 commit comments

Comments
 (0)