diff --git a/test/parallel/test-async-wrap-getasyncid.js b/test/parallel/test-async-wrap-getasyncid.js index cdb97ef8f27bc8..a693f94efbb9d1 100644 --- a/test/parallel/test-async-wrap-getasyncid.js +++ b/test/parallel/test-async-wrap-getasyncid.js @@ -160,6 +160,7 @@ if (common.hasCrypto) { const stream_wrap = process.binding('stream_wrap'); const tcp_wrap = process.binding('tcp_wrap'); const server = net.createServer(common.mustCall((socket) => { + server.close(); socket.on('data', (x) => { socket.end(); socket.destroy(); @@ -176,7 +177,6 @@ if (common.hasCrypto) { sreq.oncomplete = common.mustCall(() => { handle.close(); - server.close(); }); wreq.handle = handle;