From 179cbc0c25e296a044b5bb12b44d03d83baf40a8 Mon Sep 17 00:00:00 2001 From: Stanislas Date: Fri, 12 Dec 2025 23:38:12 +0100 Subject: [PATCH] fix: increase DNS test retries and use seq for loop (#1370) - Increase DNS retry count from 5 to 10 for improved test reliability when Unbound needs more time to initialize - Refactor retry loop to use `seq` with a `DNS_MAX_RETRIES` to be cleaner --- test/client-entrypoint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/client-entrypoint.sh b/test/client-entrypoint.sh index 4dba5bf..0e85117 100755 --- a/test/client-entrypoint.sh +++ b/test/client-entrypoint.sh @@ -84,7 +84,8 @@ fi # Test 3: DNS resolution through Unbound echo "Test 3: Testing DNS resolution via Unbound (10.8.0.1)..." DNS_SUCCESS=false -for i in 1 2 3 4 5; do +DNS_MAX_RETRIES=10 +for i in $(seq 1 $DNS_MAX_RETRIES); do DIG_OUTPUT=$(dig @10.8.0.1 example.com +short +time=5 2>&1) if [ -n "$DIG_OUTPUT" ] && ! echo "$DIG_OUTPUT" | grep -qi "timed out\|SERVFAIL\|connection refused"; then DNS_SUCCESS=true @@ -98,7 +99,7 @@ if [ "$DNS_SUCCESS" = true ]; then echo "PASS: DNS resolution through Unbound works" echo "Resolved example.com to: $(dig @10.8.0.1 example.com +short +time=5)" else - echo "FAIL: DNS resolution through Unbound failed after 5 attempts" + echo "FAIL: DNS resolution through Unbound failed after $DNS_MAX_RETRIES attempts" dig @10.8.0.1 example.com +time=5 || true exit 1 fi