Merge pull request #6227 from julek-wolfssl/hwsim-retry

Retry hwsim tests 3 times on fail
This commit is contained in:
David Garske
2023-03-29 12:34:19 -07:00
committed by GitHub

View File

@ -189,12 +189,25 @@ 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
echo "test ran $i times"
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