From cfa1b7ad370d8e28798a7cb47d91a08439d77f7a Mon Sep 17 00:00:00 2001 From: norbjd Date: Sun, 7 Apr 2024 18:06:00 +0200 Subject: [PATCH] [WIP] increase livenessProbe failure threshold as I'm not sure it should return EOF --- config/300-gateway.yaml | 2 +- test/e2e-kind.sh | 11 ++++++++++- test/gracefulshutdown/gracefulshutdown_test.go | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/config/300-gateway.yaml b/config/300-gateway.yaml index ca24d01f4..2955a6a06 100644 --- a/config/300-gateway.yaml +++ b/config/300-gateway.yaml @@ -112,7 +112,7 @@ spec: scheme: HTTP initialDelaySeconds: 10 periodSeconds: 5 - failureThreshold: 6 + failureThreshold: 40 resources: requests: cpu: 200m diff --git a/test/e2e-kind.sh b/test/e2e-kind.sh index e413f2f7a..a1e7ba22f 100755 --- a/test/e2e-kind.sh +++ b/test/e2e-kind.sh @@ -202,7 +202,15 @@ export "GATEWAY_NAMESPACE_OVERRIDE=${KOURIER_GATEWAY_NAMESPACE}" echo ">> Change DRAIN_TIME_SECONDS and terminationGracePeriodSeconds for graceful shutdown tests" export DRAIN_TIME_SECONDS=30 kubectl -n "${KOURIER_GATEWAY_NAMESPACE}" set env deployment 3scale-kourier-gateway DRAIN_TIME_SECONDS="$DRAIN_TIME_SECONDS" -kubectl -n "${KOURIER_GATEWAY_NAMESPACE}" patch deployment/3scale-kourier-gateway -p '{"spec": {"template": {"spec": {"terminationGracePeriodSeconds": 60}}}}' +kubectl -n "${KOURIER_GATEWAY_NAMESPACE}" patch deployment/3scale-kourier-gateway -p '{ + "spec": { + "template": { + "spec": { + "terminationGracePeriodSeconds": 60 + } + } + } +}' kubectl -n "${KOURIER_GATEWAY_NAMESPACE}" rollout status deployment/3scale-kourier-gateway --timeout=300s echo ">> Running graceful shutdown tests" @@ -212,3 +220,4 @@ go test -v -race -count=1 -timeout=20m -tags=e2e ./test/gracefulshutdown \ --cluster-suffix="$CLUSTER_SUFFIX" kubectl -n "${KOURIER_GATEWAY_NAMESPACE}" get pods -l app=3scale-kourier-gateway -o json +kubectl -n "${KOURIER_GATEWAY_NAMESPACE}" logs -l app=3scale-kourier-gateway diff --git a/test/gracefulshutdown/gracefulshutdown_test.go b/test/gracefulshutdown/gracefulshutdown_test.go index 20c5fe750..220e6402c 100644 --- a/test/gracefulshutdown/gracefulshutdown_test.go +++ b/test/gracefulshutdown/gracefulshutdown_test.go @@ -23,6 +23,7 @@ import ( "context" "errors" "fmt" + "io" "log" "net/http" "net/url" @@ -163,8 +164,7 @@ func sendRequest(client *http.Client, name string, requestTimeout time.Duration) resp, err := client.Do(req) if err != nil { var errURL *url.Error - if errors.As(err, &errURL) { - log.Printf("sendRequest %s: err: %+v, %+v, %+v, %+v", requestTimeout, errURL.Op, errURL.URL, errURL.Err, errURL.Unwrap()) + if errors.As(err, &errURL) && errURL.Unwrap() == io.EOF { return 0, nil }