@camunda/e2e-test-suite 0.0.757 → 0.0.758

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -393,9 +393,32 @@ _curl_common() {
393
393
  # with a short backoff. Without this, brief network blips during long test
394
394
  # runs surface as empty responses (`<none>` status) and false-positive
395
395
  # FAILEDs in print_result. --max-time still bounds total time per attempt.
396
- curl --http1.1 --max-time 30 --connect-timeout 10 \
397
- --retry 3 --retry-delay 1 --retry-connrefused --retry-all-errors \
398
- -i -s -H 'Expect:' "$@"
396
+ #
397
+ # Outer gateway-retry loop: an nginx `502 Bad Gateway` / `504 Gateway
398
+ # Timeout` (or an empty/no-status response) is emitted by the ingress when
399
+ # it cannot reach the upstream orchestration REST API — e.g. while an
400
+ # orchestration pod is rolling during an upgrade-minor run. That is never a
401
+ # valid response to any assertion in this suite (the API returns JSON status
402
+ # bodies, never a bare nginx HTML page), so re-issue the whole request with
403
+ # capped backoff to ride out a brief upstream restart window. curl's own
404
+ # --retry budget (~4s) is too small for a pod restart; this widens it to
405
+ # ~90s. A sustained outage still returns the real 502/504 once the budget is
406
+ # exhausted, so it surfaces as a genuine FAILED (not masked).
407
+ local gw_attempt=0 gw_max=12 gw_response gw_status
408
+ while :; do
409
+ gw_response="$(curl --http1.1 --max-time 30 --connect-timeout 10 \
410
+ --retry 3 --retry-delay 1 --retry-connrefused --retry-all-errors \
411
+ -i -s -H 'Expect:' "$@")"
412
+ gw_status="$(echo "$gw_response" | grep -m1 -E '^HTTP/[0-9.]+' | awk '{print $2}' || true)"
413
+ if { [[ "$gw_status" != "502" && "$gw_status" != "504" && -n "$gw_status" ]]; } \
414
+ || (( gw_attempt >= gw_max )); then
415
+ printf '%s\n' "$gw_response"
416
+ return 0
417
+ fi
418
+ gw_attempt=$((gw_attempt + 1))
419
+ # Backoff 2,4,6,8,10,10,... capped at 10s -> ~90s total across 12 attempts.
420
+ sleep $(( gw_attempt < 5 ? gw_attempt * 2 : 10 ))
421
+ done
399
422
  }
400
423
 
401
424
  # Helper to get curl -F argument for tenantId in multipart forms
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.757",
3
+ "version": "0.0.758",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",
@@ -393,9 +393,32 @@ _curl_common() {
393
393
  # with a short backoff. Without this, brief network blips during long test
394
394
  # runs surface as empty responses (`<none>` status) and false-positive
395
395
  # FAILEDs in print_result. --max-time still bounds total time per attempt.
396
- curl --http1.1 --max-time 30 --connect-timeout 10 \
397
- --retry 3 --retry-delay 1 --retry-connrefused --retry-all-errors \
398
- -i -s -H 'Expect:' "$@"
396
+ #
397
+ # Outer gateway-retry loop: an nginx `502 Bad Gateway` / `504 Gateway
398
+ # Timeout` (or an empty/no-status response) is emitted by the ingress when
399
+ # it cannot reach the upstream orchestration REST API — e.g. while an
400
+ # orchestration pod is rolling during an upgrade-minor run. That is never a
401
+ # valid response to any assertion in this suite (the API returns JSON status
402
+ # bodies, never a bare nginx HTML page), so re-issue the whole request with
403
+ # capped backoff to ride out a brief upstream restart window. curl's own
404
+ # --retry budget (~4s) is too small for a pod restart; this widens it to
405
+ # ~90s. A sustained outage still returns the real 502/504 once the budget is
406
+ # exhausted, so it surfaces as a genuine FAILED (not masked).
407
+ local gw_attempt=0 gw_max=12 gw_response gw_status
408
+ while :; do
409
+ gw_response="$(curl --http1.1 --max-time 30 --connect-timeout 10 \
410
+ --retry 3 --retry-delay 1 --retry-connrefused --retry-all-errors \
411
+ -i -s -H 'Expect:' "$@")"
412
+ gw_status="$(echo "$gw_response" | grep -m1 -E '^HTTP/[0-9.]+' | awk '{print $2}' || true)"
413
+ if { [[ "$gw_status" != "502" && "$gw_status" != "504" && -n "$gw_status" ]]; } \
414
+ || (( gw_attempt >= gw_max )); then
415
+ printf '%s\n' "$gw_response"
416
+ return 0
417
+ fi
418
+ gw_attempt=$((gw_attempt + 1))
419
+ # Backoff 2,4,6,8,10,10,... capped at 10s -> ~90s total across 12 attempts.
420
+ sleep $(( gw_attempt < 5 ? gw_attempt * 2 : 10 ))
421
+ done
399
422
  }
400
423
 
401
424
  # Helper to get curl -F argument for tenantId in multipart forms