From 43ed94974325936fbf0cd5124656a2a475019405 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Thu, 16 May 2024 17:23:11 +0200 Subject: [PATCH] fixup! test: remove timers from test-tls-socket-close --- test/parallel/test-tls-socket-close.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-tls-socket-close.js b/test/parallel/test-tls-socket-close.js index 2e7f562e6de706..be941af46eede2 100644 --- a/test/parallel/test-tls-socket-close.js +++ b/test/parallel/test-tls-socket-close.js @@ -29,10 +29,10 @@ let netSocketCloseEmitted = false; const netServer = net.createServer((socket) => { netSocket = socket; tlsServer.emit('connection', socket); - socket.on('close', () => { + socket.on('close', common.mustCall(() => { netSocketCloseEmitted = true; assert.strictEqual(serverTlsSocket.destroyed, true); - }); + })); }).listen(0, common.mustCall(() => { connectClient(netServer); })); @@ -61,9 +61,6 @@ function connectClient(server) { // Close callbacks are executed after `setImmediate()` callbacks. assert.strictEqual(netSocketCloseEmitted, false); assert.strictEqual(serverTlsSocket.destroyed, false); - setImmediate(() => { - assert.strictEqual(netSocketCloseEmitted, true); - }); }); });