diff --git a/test/parallel/test-http-server-keepalive-req-gc.js b/test/parallel/test-http-server-keepalive-req-gc.js index aa4bf1a3de9c83..77defb5154676e 100644 --- a/test/parallel/test-http-server-keepalive-req-gc.js +++ b/test/parallel/test-http-server-keepalive-req-gc.js @@ -16,7 +16,7 @@ if (common.isWindows) { let client; const server = createServer(common.mustCall((req, res) => { - onGC(req, { ongc: common.mustCall() }); + onGC(req, { ongc: common.mustCall(() => { server.close(); }) }); req.resume(); req.on('end', common.mustCall(() => { setImmediate(() => { @@ -27,8 +27,6 @@ const server = createServer(common.mustCall((req, res) => { res.end('hello world'); })); -server.unref(); - server.listen(0, common.mustCall(() => { client = connect(server.address().port);