Capture more dumps on failure. (#17412)

Capture *.hprof, hs_err_pid*, replay_pid*, and core.NNNN on failure.
This commit is contained in:
Gian Merlino 2024-10-26 21:25:46 -07:00 committed by GitHub
parent 7306d280cc
commit 65acc86756
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 12 deletions

View File

@ -117,27 +117,30 @@ jobs:
MAVEN_PROJECTS: ${{ inputs.maven_projects }} MAVEN_PROJECTS: ${{ inputs.maven_projects }}
run: ./.github/scripts/unit_tests_script.sh run: ./.github/scripts/unit_tests_script.sh
- name: Check for .hprof files on failure - name: Check for dumps on failure
if: ${{ failure() }} if: ${{ failure() }}
id: check_for_heap_dump id: check_for_dumps
run: | run: |
if ls ${GITHUB_WORKSPACE}/target/*.hprof 1> /dev/null 2>&1; then if test -n "$(find "${GITHUB_WORKSPACE}" \( -name '*.hprof' -or -name 'hs_err_pid*' -or -name 'replay_pid*' -or -regex '.*/core\.[0-9]*' \))"
echo "found_hprof=true" >> "$GITHUB_ENV" then
echo "found_dumps=true" >> "$GITHUB_ENV"
else else
echo "found_hprof=false" >> "$GITHUB_ENV" echo "found_dumps=false" >> "$GITHUB_ENV"
fi fi
- name: Collect tarball hprof dumps if they exist on failure - name: Collect dumps if they exist on failure
if: ${{ failure() && env.found_hprof == 'true' }} if: ${{ failure() && env.found_dumps == 'true' }}
run: | run: |
tar cvzf ${RUNNER_TEMP}/hprof-dumps.tgz ${GITHUB_WORKSPACE}/target/*.hprof find "${GITHUB_WORKSPACE}" \
\( -name '*.hprof' -or -name 'hs_err_pid*' -or -name 'replay_pid*' -or -regex '.*/core\.[0-9]*' \) \
-exec tar -cvzf ${RUNNER_TEMP}/failure-dumps.tar.gz {} +
- name: Upload hprof dumps to GitHub if they exist on failure - name: Upload dumps to GitHub if they exist on failure
if: ${{ failure() && env.found_hprof == 'true' }} if: ${{ failure() && env.found_dumps == 'true' }}
uses: actions/upload-artifact@master uses: actions/upload-artifact@master
with: with:
name: Hprof-${{ inputs.group }} hprof dumps (Compile=jdk${{ inputs.build_jdk }}, Run=jdk${{ inputs.runtime_jdk }}) name: Failure-${{ inputs.group }} failure dumps (Compile=jdk${{ inputs.build_jdk }}, Run=jdk${{ inputs.runtime_jdk }})
path: ${{ runner.temp }}/hprof-dumps.tgz path: ${{ runner.temp }}/failure-dumps.tar.gz
- name: set outputs on failure - name: set outputs on failure
id: set_outputs id: set_outputs