From 00cd5fda9458bdc53b29ba75a05037db6b73e294 Mon Sep 17 00:00:00 2001 From: leej3 <“johnleenimh@gmail.com> Date: Thu, 9 May 2024 16:03:03 +0000 Subject: [PATCH] improve retries make logging more explicit and do not use /tmp incase it is cleared. --- .github/workflows/unit-tests.yml | 12 +++++++++--- tests/common-test-functionality.sh | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index b71e89046b9f..d93cb7dafe69 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -128,9 +128,15 @@ jobs: command: SKIP_DISTRIB_TESTS=${{ matrix.skip-distrib-tests }} bash tests/run_cpu_tests.sh on_retry_command: | echo sending kill signal until process group no longer exists... - tests_pid=$(cat /tmp/ignite_testing.pid) - kill -0 -- -$tests_pid && kill -INT -- -$tests_pid && sleep 5 - while kill -0 -- -$tests_pid > /dev/null 2>&1; do kill -9 -- -$tests_pid; sleep 3; done + if [ -f .ignite_testing.pid ] && [ -s .ignite_testing.pid ]; then + tests_pid=$(cat .ignite_testing.pid) + kill -0 -- -$tests_pid && kill -INT -- -$tests_pid && sleep 5 + set -x + while kill -0 -- -$tests_pid > /dev/null 2>&1; do kill -9 -- -$tests_pid; sleep 3; done + else + echo "File .ignite_testing.pid does not exist or is empty" + fi + new_command_on_retry: USE_LAST_FAILED=1 SKIP_DISTRIB_TESTS=${{ matrix.skip-distrib-tests }} bash tests/run_cpu_tests.sh - name: Upload coverage to Codecov diff --git a/tests/common-test-functionality.sh b/tests/common-test-functionality.sh index 73467b6af22a..b289d6bb37f9 100644 --- a/tests/common-test-functionality.sh +++ b/tests/common-test-functionality.sh @@ -18,7 +18,7 @@ run_tests() { # Always clean up pytest.ini trap 'rm -f pytest.ini' RETURN # write out the process id so that we can send signals... - echo $$ > /tmp/ignite_testing.pid + echo $$ > .ignite_testing.pid # Parse arguments while [[ $# -gt 0 ]] do