diff --git a/benchmark/run.js b/benchmark/run.js index ea0dc415e91ec6..4948292437fdde 100644 --- a/benchmark/run.js +++ b/benchmark/run.js @@ -3,6 +3,7 @@ const path = require('path'); const { spawn, fork } = require('node:child_process'); const CLI = require('./_cli.js'); +const { styleText } = require('node:util'); const cli = new CLI(`usage: ./node run.js [options] [--] ... Run each benchmark in the directory a single time, more than one @@ -16,6 +17,7 @@ const cli = new CLI(`usage: ./node run.js [options] [--] ... Default: 1 --set variable=value set benchmark variable (can be repeated) --format [simple|csv] optional value that specifies the output format + --track Display the time elapsed to run each benchmark file. test only run a single configuration from the options matrix all each benchmark category is run one after the other @@ -25,7 +27,7 @@ const cli = new CLI(`usage: ./node run.js [options] [--] ... --set CPUSET=0-2 Specifies that benchmarks should run on CPU cores 0 to 2. Note: The CPUSET format should match the specifications of the 'taskset' command on your system. -`, { arrayArgs: ['set', 'filter', 'exclude'] }); +`, { arrayArgs: ['set', 'filter', 'exclude'], boolArgs: ['track'] }); const benchmarks = cli.benchmarks(); @@ -107,7 +109,12 @@ async function run() { } while (runs-- > 0) { + const start = performance.now(); await runBenchmark(filename); + if (format !== 'csv' && cli.optional.track) { + const ms = styleText(['bold', 'yellow'], `${Math.round(performance.now() - start)}ms`); + console.log(`[${ms}] ${filename}`); + } } } } diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index 202ed756c98d8a..87addfa8fbbaf3 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -123,12 +123,11 @@ static int StartDebugSignalHandler() { CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &savemask)); sigmask = savemask; pthread_t thread; - const int err = pthread_create(&thread, &attr, - StartIoThreadMain, nullptr); - // Restore original mask - CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr)); + const int err = pthread_create(&thread, &attr, StartIoThreadMain, nullptr); CHECK_EQ(0, pthread_attr_destroy(&attr)); if (err != 0) { + // Restore original mask + CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr)); fprintf(stderr, "node[%u]: pthread_create: %s\n", uv_os_getpid(), strerror(err)); fflush(stderr); @@ -137,6 +136,8 @@ static int StartDebugSignalHandler() { return -err; } RegisterSignalHandler(SIGUSR1, StartIoThreadWakeup); + // Restore original mask + CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr)); // Unblock SIGUSR1. A pending SIGUSR1 signal will now be delivered. sigemptyset(&sigmask); sigaddset(&sigmask, SIGUSR1); diff --git a/src/node_watchdog.cc b/src/node_watchdog.cc index 7a493bf460701f..3ea43177a4d75e 100644 --- a/src/node_watchdog.cc +++ b/src/node_watchdog.cc @@ -308,7 +308,10 @@ int SigintWatchdogHelper::Start() { CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &savemask)); sigmask = savemask; int ret = pthread_create(&thread_, nullptr, RunSigintWatchdog, nullptr); - CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr)); + + auto cleanup = OnScopeLeave( + [&]() { CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr)); }); + if (ret != 0) { return ret; } diff --git a/test/client-proxy/test-https-proxy-request-handshake-failure.mjs b/test/client-proxy/test-https-proxy-request-handshake-failure.mjs index df6bc446fee0e7..251d136afaa6c1 100644 --- a/test/client-proxy/test-https-proxy-request-handshake-failure.mjs +++ b/test/client-proxy/test-https-proxy-request-handshake-failure.mjs @@ -33,7 +33,6 @@ const requestUrl = `https://${serverHost}/test`; const { code, signal, stderr, stdout } = await runProxiedRequest({ NODE_USE_ENV_PROXY: 1, REQUEST_URL: requestUrl, - REQUEST_TIMEOUT: 1000, HTTPS_PROXY: `http://localhost:${proxy.address().port}`, }); diff --git a/tools/lint-readme-lists.mjs b/tools/lint-readme-lists.mjs index 97992b79b1e32e..6ad74d6edf72fa 100755 --- a/tools/lint-readme-lists.mjs +++ b/tools/lint-readme-lists.mjs @@ -6,7 +6,7 @@ import assert from 'node:assert'; import { open } from 'node:fs/promises'; import { argv } from 'node:process'; -const ghHandleLine = /^\* \[(.+)\]\(https:\/\/github\.com\/\1\) -$/; +const ghHandleLine = /^\* \[(.+)\]\(https:\/\/github\.com\/(.+)\) -$/; const memberInfoLine = /^ {2}\*\*[^*]+\*\* <<[^@]+@.+\.[a-z]+>>( \(\w+(\/[^)/]+)+\))?( - \[Support me\]\(.+\))?$/; const lists = { @@ -59,9 +59,11 @@ for await (const line of readme.readLines()) { ); } - if (!ghHandleLine.test(line)) { - throw new Error(`${currentGithubHandle} is not formatted correctly (README.md:${lineNumber})`); + const match = line.match(ghHandleLine); + if (!match) { + throw new Error(`${line} should match ${ghHandleLine} (README.md:${lineNumber})`); } + assert.strictEqual(match[1], match[2], `GitHub handle does not match the URL (README.md:${lineNumber})`); if ( currentList === 'TSC voting members' ||