diff --git a/lib/events.js b/lib/events.js index 76b376e78911..4a8311af0592 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, { 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 diff --git a/test/sequential/test-tls-securepair-client.js b/test/sequential/test-tls-securepair-client.js index c450410baf90..d5e2b7b7d2b0 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');