From e73ae077dc1b3ad1cea6d7ef0e4c01d93f32586b Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Wed, 22 Mar 2023 19:16:47 +0100 Subject: [PATCH] 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