Skip to content

Commit 3c12ff7

Browse files
committed
build: add manually-dispatched stress-test workflow
Add a GitHub action workflow that can be manually dispatched to stress-run tests on a PR/branch to verify flakiness. Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
1 parent bfb2fa7 commit 3c12ff7

1 file changed

Lines changed: 113 additions & 0 deletions

File tree

.github/workflows/stress-test.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Stress Test
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
test_path:
7+
description: Test path or glob (e.g. test/parallel/test-debugger-break.js or "test/parallel/test-debugger-*")
8+
required: true
9+
type: string
10+
os:
11+
description: Runner to use
12+
required: true
13+
default: macos-15
14+
type: choice
15+
options:
16+
- macos-15
17+
- ubuntu-24.04
18+
- ubuntu-24.04-arm
19+
repeat:
20+
description: Number of times to repeat each test (--repeat)
21+
required: true
22+
default: '1000'
23+
type: string
24+
test_jobs:
25+
description: Number of jobs to run in parallel (-j).
26+
required: true
27+
default: '1'
28+
type: string
29+
test_args:
30+
description: Extra args for tools/test.py, space-separated (e.g. "-t 10 --worker")
31+
required: false
32+
default: ''
33+
type: string
34+
35+
env:
36+
PYTHON_VERSION: '3.14'
37+
XCODE_VERSION: '16.4'
38+
CLANG_VERSION: '19'
39+
RUSTC_VERSION: '1.82'
40+
41+
permissions:
42+
contents: read
43+
44+
jobs:
45+
stress-test:
46+
runs-on: ${{ inputs.os }}
47+
env:
48+
# Linux builds with clang (matching test-linux.yml), macOS with gcc/g++.
49+
CC: ${{ startsWith(inputs.os, 'ubuntu') && 'sccache clang-19' || 'sccache gcc' }}
50+
CXX: ${{ startsWith(inputs.os, 'ubuntu') && 'sccache clang++-19' || 'sccache g++' }}
51+
SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
52+
SCCACHE_IDLE_TIMEOUT: '0'
53+
steps:
54+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
55+
with:
56+
persist-credentials: false
57+
path: node
58+
- name: Install Clang ${{ env.CLANG_VERSION }}
59+
if: runner.os == 'Linux'
60+
uses: ./node/.github/actions/install-clang
61+
with:
62+
clang-version: ${{ env.CLANG_VERSION }}
63+
- name: Set up Xcode ${{ env.XCODE_VERSION }}
64+
if: runner.os == 'macOS'
65+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
66+
- name: Set up Python ${{ env.PYTHON_VERSION }}
67+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
68+
with:
69+
python-version: ${{ env.PYTHON_VERSION }}
70+
allow-prereleases: true
71+
- name: Install Rust ${{ env.RUSTC_VERSION }}
72+
run: |
73+
rustup override set "$RUSTC_VERSION"
74+
rustup --version
75+
- name: Set up sccache
76+
uses: Mozilla-Actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
77+
with:
78+
version: v0.16.0
79+
- name: Environment Information
80+
run: npx envinfo@7.21.0
81+
# This is needed due to https://github.com/nodejs/build/issues/3878
82+
- name: Cleanup
83+
if: runner.os == 'macOS'
84+
run: |
85+
echo "::group::Free space before cleanup"
86+
df -h
87+
echo "::endgroup::"
88+
echo "::group::Cleaned Files"
89+
90+
sudo rm -rf /Users/runner/Library/Android/sdk
91+
92+
echo "::endgroup::"
93+
echo "::group::Free space after cleanup"
94+
df -h
95+
echo "::endgroup::"
96+
- name: Build
97+
run: make -C node build-ci -j"$(getconf _NPROCESSORS_ONLN)" V=1 CONFIG_FLAGS="--error-on-warn --v8-enable-temporal-support"
98+
- name: Stress run ${{ inputs.test_path }} x${{ inputs.repeat }}
99+
shell: bash
100+
env:
101+
REPEAT: ${{ inputs.repeat }}
102+
JOBS: ${{ inputs.test_jobs }}
103+
TEST_ARGS: ${{ inputs.test_args }}
104+
TEST_PATH: ${{ inputs.test_path }}
105+
run: |
106+
cd node
107+
read -ra EXTRA_ARGS <<< "$TEST_ARGS"
108+
python3 tools/test.py \
109+
--repeat "$REPEAT" \
110+
-j "$JOBS" \
111+
-p actions \
112+
"${EXTRA_ARGS[@]}" \
113+
"$TEST_PATH"

0 commit comments

Comments
 (0)