From 9ac42f1be42f162ec9cf6bb56e817d7b210a6db9 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 29 Feb 2020 09:48:44 -0800 Subject: [PATCH 1/3] test: remove common.port from test-tls-securepair-client OpenSSL s_server accepts port 0 as an indicator to use an open port provided by the operating system. Use that instead of common.PORT in the test. Remove 500ms delay added in 8e461673c44cb550a7aadc20f0af6453810f1b18. Hopefully the race condition in OpenSSL s_server has been fixed and/or the change to port 0 means that the server is listening by the time the ACCEPT text is printed and the setTimeout() is no longer necessary. PR-URL: https://github.com/nodejs/node/pull/32024 Reviewed-By: Ben Coe Reviewed-By: Sam Roberts --- test/sequential/test-tls-securepair-client.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/sequential/test-tls-securepair-client.js b/test/sequential/test-tls-securepair-client.js index c450410baf907c..d5e2b7b7d2b08d 100644 --- a/test/sequential/test-tls-securepair-client.js +++ b/test/sequential/test-tls-securepair-client.js @@ -62,7 +62,7 @@ function test(keyPath, certPath, check, next) { const cert = fixtures.readSync(certPath).toString(); const server = spawn(common.opensslCli, ['s_server', - '-accept', common.PORT, + '-accept', 0, '-cert', fixtures.path(certPath), '-key', fixtures.path(keyPath)]); server.stdout.pipe(process.stdout); @@ -78,10 +78,11 @@ function test(keyPath, certPath, check, next) { console.log(state); switch (state) { case 'WAIT-ACCEPT': - if (/ACCEPT/.test(serverStdoutBuffer)) { - // Give s_server half a second to start up. - setTimeout(startClient, 500); + const matches = serverStdoutBuffer.match(/ACCEPT .*?:(\d+)/); + if (matches) { + const port = matches[1]; state = 'WAIT-HELLO'; + startClient(port); } break; @@ -117,7 +118,7 @@ function test(keyPath, certPath, check, next) { }); - function startClient() { + function startClient(port) { const s = new net.Stream(); const sslcontext = tls.createSecureContext({ key, cert }); @@ -131,7 +132,7 @@ function test(keyPath, certPath, check, next) { pair.encrypted.pipe(s); s.pipe(pair.encrypted); - s.connect(common.PORT); + s.connect(port); s.on('connect', function() { console.log('client connected'); From 5e1f059db4f8b324ef4448e0fbdc5dc7fc6c57d8 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 29 Feb 2020 10:07:41 -0800 Subject: [PATCH 2/3] test: move test-inspector-module to parallel test-inspector-module is very fast and seems to be runnable at the same time as other tests. Move from sequential directory to parallel. PR-URL: https://github.com/nodejs/node/pull/32025 Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca --- test/{sequential => parallel}/test-inspector-module.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/{sequential => parallel}/test-inspector-module.js (100%) diff --git a/test/sequential/test-inspector-module.js b/test/parallel/test-inspector-module.js similarity index 100% rename from test/sequential/test-inspector-module.js rename to test/parallel/test-inspector-module.js From ed8007af0bc8fd4fa575217b50e8ca611a7e8679 Mon Sep 17 00:00:00 2001 From: Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> Date: Tue, 18 Feb 2020 15:33:31 +0100 Subject: [PATCH 3/3] events: convert errorMonitor to a normal property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert property errorMonitor to a normal property as non-writable caused unwanted side effects. Refs: https://github.com/nodejs/node/pull/30932#discussion_r379679982 PR-URL: https://github.com/nodejs/node/pull/31848 Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Matheus Marchini Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig --- lib/events.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/events.js b/lib/events.js index 76b376e789115f..4a8311af059295 100644 --- a/lib/events.js +++ b/lib/events.js @@ -90,12 +90,7 @@ ObjectDefineProperty(EventEmitter, 'captureRejections', { enumerable: true }); -ObjectDefineProperty(EventEmitter, 'errorMonitor', { - value: kErrorMonitor, - writable: false, - configurable: true, - enumerable: true -}); +EventEmitter.errorMonitor = kErrorMonitor; // The default for captureRejections is false ObjectDefineProperty(EventEmitter.prototype, kCapture, {