Skip to content

Commit

Permalink
tests: Increase retries on the external tests
Browse files Browse the repository at this point in the history
The external tests are heavily dependent on the testing environment,
because they reach out to live external resolvers.

Because of it, they are quite sensitive to transient failures, and this
is often experienced as flakiness in the Github CI.

To make these less flaky, this patch increases the retries, with
incremental delay between each attempt.
  • Loading branch information
albertito committed Nov 17, 2024
1 parent 5a08a71 commit 337dedc
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions tests/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,23 @@ do
echo "## DoH against $server"
dnss -enable_dns_to_https -dns_listen_addr "localhost:1053" \
-https_upstream "$server"
# Retry once after giving it some time, because the test environment
# and/or the server may be flaky.
if ! resolve; then
echo
echo "### Retrying in 1s"
sleep 1
resolve
fi

# Retry a few times with some delay in between, because the test
# environment and/or the server may be flaky.
success=0
for delay_sec in 0 1 3 5 10; do
sleep $delay_sec
if resolve; then
success=1
break
fi
done

kill $PID
if [ "$success" -ne 1 ]; then
echo "Failed to resolve with upstream $server"
exit 1
fi
done


Expand Down

0 comments on commit 337dedc

Please sign in to comment.