Skip to content

Commit

Permalink
test: add mustCall to http-abort-queued test
Browse files Browse the repository at this point in the history
PR-URL: #27447
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Yorkie Liu <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ouyang Yadong <[email protected]>
  • Loading branch information
tsyeyuanfeng authored and targos committed Apr 30, 2019
1 parent 9c842f4 commit f4124d5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/parallel/test-http-abort-queued.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const http = require('http');

let complete;

const server = http.createServer((req, res) => {
const server = http.createServer(common.mustCall((req, res) => {
// We should not see the queued /thatotherone request within the server
// as it should be aborted before it is sent.
assert.strictEqual(req.url, '/');
Expand All @@ -37,10 +37,9 @@ const server = http.createServer((req, res) => {
complete = complete || function() {
res.end();
};
});
}));


server.listen(0, () => {
server.listen(0, common.mustCall(() => {
const agent = new http.Agent({ maxSockets: 1 });
assert.strictEqual(Object.keys(agent.sockets).length, 0);

Expand Down Expand Up @@ -93,4 +92,4 @@ server.listen(0, () => {
});

req1.end();
});
}));

0 comments on commit f4124d5

Please sign in to comment.