From 987596ffb0d2a1d9db53adc40dfc6f0ce86c75e1 Mon Sep 17 00:00:00 2001 From: Ben Miner Date: Thu, 6 Feb 2025 13:14:30 -0600 Subject: [PATCH 1/4] fix: update test.sh for newer node versions --- system-test/system_test.sh | 2 +- system-test/test.sh | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/system-test/system_test.sh b/system-test/system_test.sh index c29f718c..40484f38 100755 --- a/system-test/system_test.sh +++ b/system-test/system_test.sh @@ -14,7 +14,7 @@ cd $(dirname $0) # official releases. https://nodejs.org/en/about/releases/ if [[ -z "$BINARY_HOST" ]]; then ADDITIONAL_PACKAGES="python3 g++ make" - NODE_VERSIONS=(14 16 18 20) + NODE_VERSIONS=(14 16 18 20 21 22) else # Tested versions for pre-built binaries are limited based on # what node-pre-gyp can specify as its target version. diff --git a/system-test/test.sh b/system-test/test.sh index 9c632f32..4f112061 100755 --- a/system-test/test.sh +++ b/system-test/test.sh @@ -55,17 +55,31 @@ if [[ "$VERIFY_TIME_LINE_NUMBERS" != "true" ]]; then npm run compile fi +NODE_VERSION=$(node -v | cut -d. -f1 | tr -d 'v') node -v node --trace-warnings "$BENCHPATH" 10 $VERIFY_TIME_LINE_NUMBERS if [[ "$VERIFY_TIME_LINE_NUMBERS" == "true" ]]; then - pprof -lines -top -nodecount=2 time.pb.gz | tee $tty | \ - grep "busyLoop.*src/busybench.js:[2-3][08-9]" - pprof -filefunctions -top -nodecount=2 heap.pb.gz | tee $tty | \ - grep "busyLoop.*src/busybench.js" + output=$(pprof -lines -top -nodecount=2 time.pb.gz | tee $tty) + + # Due to V8 changes in Node 21, the line numbers are different. + # It also emits "anonymous" and "idle" statuses in the output. + # E.G: 1877ms 74.93% 74.93% 1878ms 74.97% (anonymous) file:/tmp/tmp.xyz/busybench/src/busybench.js:34 + if [ "$NODE_VERSION" -ge 21 ]; then + grep "anonymous.*busybench.js:3[0-9]" <<< "$output" + else + grep "busyLoop.*src/busybench.js:[23][0-9]" <<< "$output" + fi + + heap_output=$(pprof -filefunctions -top -nodecount=2 heap.pb.gz | tee $tty) + grep "busyLoop.*src/busybench.js" <<< "$heap_output" else - pprof -filefunctions -top -nodecount=2 time.pb.gz | tee $tty | \ - grep "busyLoop.*src/busybench.ts" + output=$(pprof -filefunctions -top -nodecount=2 time.pb.gz | tee $tty) + if [ "$NODE_VERSION" -ge 21 ]; then + grep "anonymous.*busybench.ts" <<< "$output" + else + grep "busyLoop.*src/busybench.ts" <<< "$output" + fi pprof -filefunctions -top -nodecount=2 heap.pb.gz | tee $tty | \ grep "busyLoop.*src/busybench.ts" fi From 88fccc3e9247a14bec1056ee8492d2cfc93c279b Mon Sep 17 00:00:00 2001 From: Ben Miner Date: Thu, 6 Feb 2025 13:21:32 -0600 Subject: [PATCH 2/4] fix: add node 21 and 22 to ci workflows --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f27d2273..7081e5a2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - node: [14, 16, 18, 20] + node: [14, 16, 18, 20, 21, 22] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 From 71ee5bdec04793daef329494dfd2aaf2e4fa1ca3 Mon Sep 17 00:00:00 2001 From: Ben Miner Date: Thu, 26 Jun 2025 11:17:14 -0400 Subject: [PATCH 3/4] remove nodejs21; adjust benchmark to .js instead of .ts --- system-test/system_test.sh | 2 +- system-test/test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system-test/system_test.sh b/system-test/system_test.sh index 40484f38..2032ec80 100755 --- a/system-test/system_test.sh +++ b/system-test/system_test.sh @@ -14,7 +14,7 @@ cd $(dirname $0) # official releases. https://nodejs.org/en/about/releases/ if [[ -z "$BINARY_HOST" ]]; then ADDITIONAL_PACKAGES="python3 g++ make" - NODE_VERSIONS=(14 16 18 20 21 22) + NODE_VERSIONS=(14 16 18 20 22) else # Tested versions for pre-built binaries are limited based on # what node-pre-gyp can specify as its target version. diff --git a/system-test/test.sh b/system-test/test.sh index 4f112061..5c23b0cb 100755 --- a/system-test/test.sh +++ b/system-test/test.sh @@ -76,7 +76,7 @@ if [[ "$VERIFY_TIME_LINE_NUMBERS" == "true" ]]; then else output=$(pprof -filefunctions -top -nodecount=2 time.pb.gz | tee $tty) if [ "$NODE_VERSION" -ge 21 ]; then - grep "anonymous.*busybench.ts" <<< "$output" + grep "anonymous.*busybench.js" <<< "$output" else grep "busyLoop.*src/busybench.ts" <<< "$output" fi From bb9bceff342955016da61e361ca296eb55aa274b Mon Sep 17 00:00:00 2001 From: Ben Miner Date: Thu, 26 Jun 2025 11:19:02 -0400 Subject: [PATCH 4/4] remove 21 in ci --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7081e5a2..bffb576f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - node: [14, 16, 18, 20, 21, 22] + node: [14, 16, 18, 20, 22] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4