Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
test(hcc): accept bounded gateway upstream failures
Alfredo Lopez544ed492edb6
diff --git a/scripts/e2e/e2e-hcc-readiness-bootstrap.sh b/scripts/e2e/e2e-hcc-readiness-bootstrap.shindex 134400a7b..eb485a590 100755--- a/scripts/e2e/e2e-hcc-readiness-bootstrap.sh+++ b/scripts/e2e/e2e-hcc-readiness-bootstrap.sh@@ -233,7 +233,7 @@ hcc_gateway_ready_proxy_unavailable() {pod="$(running_hcc_gateway_pod)" || return 1output="$(kctl exec "pod/${pod}" -n "$HCC_NS" -c nginx -- \- wget -O /dev/null -S http://127.0.0.1:8081/ready 2>&1+ wget -T 70 -t 1 -O /dev/null -S http://127.0.0.1:8081/ready 2>&1)" && return 1status="$(awk '@@ -245,7 +245,10 @@ hcc_gateway_ready_proxy_unavailable() {}' <<<"$output")"- [ "$status" = 502 ]+ case "$status" in+ 502|503|504) return 0 ;;+ *) return 1 ;;+ esac}hcc_gateway_remains_ready_without_hcc() {@@ -254,7 +257,9 @@ hcc_gateway_remains_ready_without_hcc() {while [ "$(date +%s)" -lt "$deadline" ]; dohcc_gateway_deployment_ready &&hcc_gateway_local_health_ok &&- hcc_gateway_ready_proxy_unavailable ||+ hcc_gateway_ready_proxy_unavailable &&+ hcc_gateway_deployment_ready &&+ hcc_gateway_local_health_ok ||return 1sleep 1donediff --git a/scripts/tests/test-hcc-api-gateway-readiness.sh b/scripts/tests/test-hcc-api-gateway-readiness.shindex 0b16b3844..7588248fd 100644--- a/scripts/tests/test-hcc-api-gateway-readiness.sh+++ b/scripts/tests/test-hcc-api-gateway-readiness.sh@@ -88,20 +88,22 @@ if [[ "${runtime_hold_function}" != *'hcc_gateway_deployment_ready'* ]] ||fiecho "PASS: bootstrap E2E proves gateway readiness remains local while HCC is unavailable"-if (- HCC_NS=control-plane- running_hcc_gateway_pod() { printf '%s\n' gateway-pod; }- kctl() {- printf '%s\n' ' HTTP/1.1 502 Bad Gateway'- return 8- }- eval "${unavailable_probe_function}"- hcc_gateway_ready_proxy_unavailable-); then- echo "PASS: gateway hold accepts the explicit upstream-unavailable HTTP status"-else- fail "gateway hold rejects the expected upstream-unavailable HTTP status"-fi+for unavailable_status in 502 503 504; do+ if (+ HCC_NS=control-plane+ running_hcc_gateway_pod() { printf '%s\n' gateway-pod; }+ kctl() {+ printf ' HTTP/1.1 %s upstream unavailable\n' "${unavailable_status}"+ return 8+ }+ eval "${unavailable_probe_function}"+ hcc_gateway_ready_proxy_unavailable+ ); then+ echo "PASS: gateway hold accepts explicit upstream-unavailable HTTP ${unavailable_status}"+ else+ fail "gateway hold rejects expected upstream-unavailable HTTP ${unavailable_status}"+ fi+doneif (HCC_NS=control-plane