From e73ae077dc1b3ad1cea6d7ef0e4c01d93f32586b Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Wed, 22 Mar 2023 19:16:47 +0100 Subject: [PATCH 1/2] Retry hwsim tests 3 times on fail --- .github/workflows/hostap.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/hostap.yml b/.github/workflows/hostap.yml index 7fb6d27c5..d0fd2c1c3 100644 --- a/.github/workflows/hostap.yml +++ b/.github/workflows/hostap.yml @@ -189,12 +189,24 @@ jobs: id: testing working-directory: hostap/tests/hwsim/ run: | - # Run tests in increments of 100 to cut down on the uploaded log size. - while mapfile -t -n 100 ary && ((${#ary[@]})); do + # Run tests in increments of 50 to cut down on the uploaded log size. + while mapfile -t -n 50 ary && ((${#ary[@]})); do TESTS=$(printf '%s\n' "${ary[@]}" | tr '\n' ' ') - sudo ./start.sh - sudo ./run-tests.py ${{ env.hostap_debug_flags }} --split ${{ matrix.server }}/5 $TESTS - sudo ./stop.sh + # Retry up to three times + for i in {1..3}; do + HWSIM_RES=0 + # Logs can grow quickly especially in debug mode + sudo rm -rf logs + sudo ./start.sh + sudo ./run-tests.py ${{ env.hostap_debug_flags }} --split ${{ matrix.server }}/5 $TESTS || HWSIM_RES=$? + sudo ./stop.sh + if [ "$HWSIM_RES" -eq "0" ]; then + break + fi + done + if [ "$HWSIM_RES" -ne "0" ]; then + exit $HWSIM_RES + fi done < $GITHUB_WORKSPACE/wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/tests - name: Change failure log permissions From 60501236cf271e614a29117337d8ef31a62f0a1c Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Fri, 24 Mar 2023 12:09:22 +0100 Subject: [PATCH 2/2] Add counter --- .github/workflows/hostap.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/hostap.yml b/.github/workflows/hostap.yml index d0fd2c1c3..9624f90ca 100644 --- a/.github/workflows/hostap.yml +++ b/.github/workflows/hostap.yml @@ -204,6 +204,7 @@ jobs: break fi done + echo "test ran $i times" if [ "$HWSIM_RES" -ne "0" ]; then exit $HWSIM_RES fi