fix(tests): retry on pattern mismatch (up to 3 times)

When API returns 200 but output doesn't match expected pattern,
retry up to 3 times. This handles cases where service operations
succeed but the service isn't fully ready yet.
This commit is contained in:
russell@unturf.com 2026-01-29 09:45:51 -05:00
parent e3dbafb701
commit 4c2aec9862

View file

@ -298,9 +298,20 @@ run_test() {
fi
continue
fi
else
# No error detected, but output didn't match expected pattern
# This can happen when API returns 200 but service isn't ready yet
# Retry a few times for service operations
if [ $attempt -lt 3 ]; then
attempt=$((attempt + 1))
retried=true
echo -n "(no-match retry $attempt/3)... "
sleep 2
continue
fi
fi
# Not a transient error, break out of retry loop
# Exhausted retries, break out of loop
break
done