Skip to content

Commit 5728cdb

Browse files
committed
[test]: Fix curl error handling in reserved IP HTTP response checks
curl -w "%{http_code}" already outputs "000" when a connection fails, then exits non-zero. Without error suppression, `set -euo pipefail` exits the script immediately. Add `|| true` to suppress the exit code while preserving curl's own `"000"` output, allowing the retry loop to continue. Signed-off-by: Moshe Vayner <moshe@vayner.me>
1 parent 77ddc9e commit 5728cdb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

e2e/test/lb-created-with-reserved-ip-linode-range/chainsaw-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ spec:
177177
#Run a curl command to the service ip
178178
URL="http://$service_ip:80/"
179179
for i in {1..10}; do
180-
HTTP_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "$URL")
180+
HTTP_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "$URL" || true)
181181
if [ "$HTTP_RESPONSE" -eq 200 ]; then
182182
echo "Request was successful (HTTP 200)"
183183
break

e2e/test/lb-created-with-reserved-ip-nb-range/chainsaw-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ spec:
209209
#Run a curl command to the service ip
210210
URL="http://$service_ip:80/"
211211
for i in {1..10}; do
212-
HTTP_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "$URL")
212+
HTTP_RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "$URL" || true)
213213
if [ "$HTTP_RESPONSE" -eq 200 ]; then
214214
echo "Request was successful (HTTP 200)"
215215
break

0 commit comments

Comments
 (0)