-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parallel.test-tls-socket-close is flaky #49902
Comments
It seems #49575 did not fully fix it. |
I wonder if we really need to check the client socket in the immediate, perhaps it's already enough, say, checking it on process exit? |
Not quite sure what the test was going for, perhaps we could also switch to EDIT: nope probably not useful |
A dumb idea: maybe we can keep checking if the client socket is destroyed in |
Before Joyee's comments I tried to remove diff --git a/test/parallel/test-tls-socket-close.js b/test/parallel/test-tls-socket-close.js
index 70af760d53..e661da94f0 100644
--- a/test/parallel/test-tls-socket-close.js
+++ b/test/parallel/test-tls-socket-close.js
@@ -6,6 +6,7 @@ if (!common.hasCrypto)
const assert = require('assert');
const tls = require('tls');
const net = require('net');
+const Countdown = require('../common/countdown');
const fixtures = require('../common/fixtures');
const key = fixtures.readKey('agent2-key.pem');
@@ -27,6 +28,10 @@ const netServer = net.createServer((socket) => {
connectClient(netServer);
}));
+const countdown = new Countdown(2, () => {
+ netServer.close();
+});
+
// A client that connects, sends one message, and closes the raw connection:
function connectClient(server) {
const clientTlsSocket = tls.connect({
@@ -42,17 +47,12 @@ function connectClient(server) {
netSocket.destroy();
- setImmediate(() => {
- assert.strictEqual(netSocket.destroyed, true);
-
- setImmediate(() => {
- assert.strictEqual(clientTlsSocket.destroyed, true);
- assert.strictEqual(serverTlsSocket.destroyed, true);
-
- tlsServer.close();
- netServer.close();
- });
- });
+ clientTlsSocket.on('close', dec);
+ serverTlsSocket.on('close', dec);
}));
}));
}
+
+function dec() {
+ countdown.dec();
+}
However the |
Ensure that the `'close'` event is emitted on a `TLSSocket` when it is created from an existing raw `net.Socket` and the raw socket is not closed cleanly (destroyed). Fixes: nodejs#49902
Ensure that the `'close'` event is emitted on a `TLSSocket` when it is created from an existing raw `net.Socket` and the raw socket is not closed cleanly (destroyed). Refs: nodejs#49902 (comment) Fixes: nodejs#49902
Ensure that the `'close'` event is emitted on a `TLSSocket` when it is created from an existing raw `net.Socket` and the raw socket is not closed cleanly (destroyed). Refs: nodejs@048e0bec5147 Refs: nodejs#49902 (comment) Fixes: nodejs#49902
Ensure that the `'close'` event is emitted on a `TLSSocket` when it is created from an existing raw `net.Socket` and the raw socket is not closed cleanly (destroyed). Refs: nodejs@048e0bec5147 Refs: nodejs#49902 (comment) Fixes: nodejs#49902
Ensure that the `'close'` event is emitted on a `TLSSocket` when it is created from an existing raw `net.Socket` and the raw socket is not closed cleanly (destroyed). Refs: 048e0bec5147 Refs: #49902 (comment) Fixes: #49902 PR-URL: #49980 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Ensure that the `'close'` event is emitted on a `TLSSocket` when it is created from an existing raw `net.Socket` and the raw socket is not closed cleanly (destroyed). Refs: nodejs@048e0bec5147 Refs: nodejs#49902 (comment) Fixes: nodejs#49902 PR-URL: nodejs#49980 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Ensure that the `'close'` event is emitted on a `TLSSocket` when it is created from an existing raw `net.Socket` and the raw socket is not closed cleanly (destroyed). Refs: 048e0bec5147 Refs: #49902 (comment) Fixes: #49902 PR-URL: #49980 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Ensure that the `'close'` event is emitted on a `TLSSocket` when it is created from an existing raw `net.Socket` and the raw socket is not closed cleanly (destroyed). Refs: nodejs@048e0bec5147 Refs: nodejs#49902 (comment) Fixes: nodejs#49902 PR-URL: nodejs#49980 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Still flaky:
|
Fixes: nodejs#49902 PR-URL: nodejs#53019 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Fixes: nodejs#49902 PR-URL: nodejs#53019 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Test
parallel.test-tls-socket-close
Platform
No response
Console output
Build links
Additional information
No response
The text was updated successfully, but these errors were encountered: