diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f27d2273..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] + node: [14, 16, 18, 20, 22] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 diff --git a/system-test/system_test.sh b/system-test/system_test.sh index c29f718c..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) + 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 9c632f32..5c23b0cb 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.js" <<< "$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