From 185d9b50dbfb027c010cebff2307163a5a80089e Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Wed, 13 Sep 2023 08:04:39 +0200 Subject: [PATCH] test: deflake test-tls-socket-close Move the check for the destroyed state of the remote socket to the inner `setImmediate()`. Refs: https://github.com/nodejs/node/pull/49327#issuecomment-1712525257 PR-URL: https://github.com/nodejs/node/pull/49575 Reviewed-By: Joyee Cheung Reviewed-By: Moshe Atlow --- test/parallel/test-tls-socket-close.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-tls-socket-close.js b/test/parallel/test-tls-socket-close.js index 667b291309a4c5..70af760d53bb4d 100644 --- a/test/parallel/test-tls-socket-close.js +++ b/test/parallel/test-tls-socket-close.js @@ -44,9 +44,9 @@ function connectClient(server) { setImmediate(() => { assert.strictEqual(netSocket.destroyed, true); - assert.strictEqual(clientTlsSocket.destroyed, true); setImmediate(() => { + assert.strictEqual(clientTlsSocket.destroyed, true); assert.strictEqual(serverTlsSocket.destroyed, true); tlsServer.close();