Skip to content

Commit

Permalink
test: add mustCall to http-abort-queued test
Browse files Browse the repository at this point in the history
  • Loading branch information
tsyeyuanfeng authored and yeyuanfeng committed Apr 29, 2019
1 parent 62d053b commit 3d4647e
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 3d4647e

Please sign in to comment.