From 7827e02ab6c71f4c973f59b4b3155e1645141c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sat, 27 Apr 2024 20:44:58 +0100 Subject: [PATCH] Work around https://github.com/ReactiveCircus/android-emulator-runner/issues/373 --- .github/workflows/instrumentation.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/instrumentation.yml b/.github/workflows/instrumentation.yml index f8cda5a..25e390a 100644 --- a/.github/workflows/instrumentation.yml +++ b/.github/workflows/instrumentation.yml @@ -277,7 +277,20 @@ jobs: - name: "Prepare script to run." id: script env: - SCRIPT: ${{ inputs.script }} + SCRIPT: | + # Workaround for https://github.com/ReactiveCircus/android-emulator-runner/issues/373 + pre_terminate_crashpad() { + # For some reason pgrep/pkill sees only crashpad_handle, not crashpad_handler, + # but it's definitely called ${ANDROID_HOME}/emulator/crashpad_handler. + + # Best-effort gracefully terminate all crashpad_handler processes. + pkill --exact --echo --signal SIGTERM crashpad_handle || return + sleep 10 + pkill --exact --echo --signal SIGKILL crashpad_handle || return + } + trap pre_terminate_crashpad EXIT + + ${{ inputs.script }} run: | script_file="${RUNNER_TEMP}/reactivecircus-android-emulator-runner-prepared-script.sh" echo "${SCRIPT}" > "${script_file}"