From b29e76b07d0a7587d4d914405a41dee80c3ff1d1 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 28 Feb 2024 12:33:03 +0000 Subject: [PATCH] Try using Powershell on Windows to fix permissions problem See gh-39761 --- .github/actions/print-jvm-thread-dumps/action.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/actions/print-jvm-thread-dumps/action.yml b/.github/actions/print-jvm-thread-dumps/action.yml index 4ce811bc00a..bab22e54897 100644 --- a/.github/actions/print-jvm-thread-dumps/action.yml +++ b/.github/actions/print-jvm-thread-dumps/action.yml @@ -3,10 +3,15 @@ description: Prints a thread dump for all running JVMs runs: using: composite steps: - - shell: bash + - if: ${{ runner.os == 'Linux' }} + shell: bash run: | - for java_pid in $(jps -q -J-XX:+PerfDisableSharedMem); do - echo "------------------------ pid $java_pid ------------------------" - jcmd $java_pid Thread.print -l + for jvm_pid in $(jps -q -J-XX:+PerfDisableSharedMem); do + jcmd $java_pid Thread.print done - exit 0 \ No newline at end of file + - if: ${{ runner.os == 'Windows' }} + shell: powershell + run: | + foreach ($jvm_pid in $(jps -q -J-XX:+PerfDisableSharedMem)) { + jcmd $jvm_pid Thread.print + }