-
-
Notifications
You must be signed in to change notification settings - Fork 35.8k
build: add manually-dispatched stress-test workflow #64118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
joyeecheung
wants to merge
1
commit into
nodejs:main
Choose a base branch
from
joyeecheung:stress-workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+113
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| name: Stress Test | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| test_path: | ||
| description: 'Test path or glob (e.g. test/parallel/test-debugger-break.js or "test/parallel/test-debugger-*")' | ||
| required: true | ||
| type: string | ||
| os: | ||
| description: 'Runner to use' | ||
| required: true | ||
| default: macos-15 | ||
| type: choice | ||
| options: | ||
| - macos-15 | ||
| - ubuntu-24.04 | ||
| - ubuntu-24.04-arm | ||
| repeat: | ||
| description: 'Number of times to repeat each test (--repeat)' | ||
| required: true | ||
| default: '1000' | ||
| type: string | ||
| test_jobs: | ||
| description: 'Number of jobs to run in parallel (-j).' | ||
| required: true | ||
| default: '1' | ||
| type: string | ||
| test_args: | ||
| description: 'Extra args for tools/test.py, space-separated (e.g. "-t 10 --worker")' | ||
| required: false | ||
| default: '' | ||
| type: string | ||
|
|
||
| env: | ||
| PYTHON_VERSION: '3.14' | ||
| XCODE_VERSION: '16.4' | ||
| CLANG_VERSION: '19' | ||
| RUSTC_VERSION: '1.82' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| stress-test: | ||
| runs-on: ${{ inputs.os }} | ||
| env: | ||
| # Linux builds with clang (matching test-linux.yml), macOS with gcc/g++. | ||
| CC: ${{ startsWith(inputs.os, 'ubuntu') && 'sccache clang-19' || 'sccache gcc' }} | ||
| CXX: ${{ startsWith(inputs.os, 'ubuntu') && 'sccache clang++-19' || 'sccache g++' }} | ||
| SCCACHE_GHA_ENABLED: ${{ github.base_ref == 'main' || github.ref_name == 'main' }} | ||
| SCCACHE_IDLE_TIMEOUT: '0' | ||
| steps: | ||
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| with: | ||
| persist-credentials: false | ||
| path: node | ||
| - name: Install Clang ${{ env.CLANG_VERSION }} | ||
| if: runner.os == 'Linux' | ||
| uses: ./node/.github/actions/install-clang | ||
| with: | ||
| clang-version: ${{ env.CLANG_VERSION }} | ||
| - name: Set up Xcode ${{ env.XCODE_VERSION }} | ||
| if: runner.os == 'macOS' | ||
| run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app | ||
| - name: Set up Python ${{ env.PYTHON_VERSION }} | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
| allow-prereleases: true | ||
| - name: Install Rust ${{ env.RUSTC_VERSION }} | ||
| run: | | ||
| rustup override set "$RUSTC_VERSION" | ||
| rustup --version | ||
| - name: Set up sccache | ||
| uses: Mozilla-Actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 | ||
| with: | ||
| version: v0.16.0 | ||
| - name: Environment Information | ||
| run: npx envinfo@7.21.0 | ||
| # This is needed due to https://github.com/nodejs/build/issues/3878 | ||
| - name: Cleanup | ||
| if: runner.os == 'macOS' | ||
| run: | | ||
| echo "::group::Free space before cleanup" | ||
| df -h | ||
| echo "::endgroup::" | ||
| echo "::group::Cleaned Files" | ||
|
|
||
| sudo rm -rf /Users/runner/Library/Android/sdk | ||
|
|
||
| echo "::endgroup::" | ||
| echo "::group::Free space after cleanup" | ||
| df -h | ||
| echo "::endgroup::" | ||
| - name: Build | ||
| run: make -C node build-ci -j"$(getconf _NPROCESSORS_ONLN)" V=1 CONFIG_FLAGS="--error-on-warn --v8-enable-temporal-support" | ||
| - name: Stress run ${{ inputs.test_path }} x${{ inputs.repeat }} | ||
| shell: bash | ||
| env: | ||
| REPEAT: ${{ inputs.repeat }} | ||
| JOBS: ${{ inputs.test_jobs }} | ||
| TEST_ARGS: ${{ inputs.test_args }} | ||
| TEST_PATH: ${{ inputs.test_path }} | ||
| run: | | ||
| cd node | ||
| read -ra EXTRA_ARGS <<< "$TEST_ARGS" | ||
| python3 tools/test.py \ | ||
| --repeat "$REPEAT" \ | ||
| -j "$JOBS" \ | ||
| -p actions \ | ||
| "${EXTRA_ARGS[@]}" \ | ||
| "$TEST_PATH" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this runs infrequently then we may not get any benefit from sccache, unless it's the sort of thing that might be re-run several times in succession?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically this would get multiple runs, e.g. one from main branch and one from PR branch, for comparison, and I think during verification it's likely to run a couple of attempts while it's being iterated on (e.g. this fix didn't make the flake go away, how about a different one, or there are several attempts to try to log more things for clues in the same PR/branch).