From 0aaa024d839861c206522a8423d83733e2ff7566 Mon Sep 17 00:00:00 2001 From: norbjd Date: Sun, 7 Apr 2024 18:14:23 +0200 Subject: [PATCH] [WIP] remove debugging related stuff --- test/e2e-kind.sh | 5 +---- test/gracefulshutdown/gracefulshutdown_test.go | 6 ++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/test/e2e-kind.sh b/test/e2e-kind.sh index a1e7ba22f..5a49dc572 100755 --- a/test/e2e-kind.sh +++ b/test/e2e-kind.sh @@ -214,10 +214,7 @@ kubectl -n "${KOURIER_GATEWAY_NAMESPACE}" patch deployment/3scale-kourier-gatewa kubectl -n "${KOURIER_GATEWAY_NAMESPACE}" rollout status deployment/3scale-kourier-gateway --timeout=300s echo ">> Running graceful shutdown tests" -go test -v -race -count=1 -timeout=20m -tags=e2e ./test/gracefulshutdown \ +go test -race -count=1 -timeout=20m -tags=e2e ./test/gracefulshutdown \ --ingressendpoint="${IPS[0]}" \ --ingressClass=kourier.ingress.networking.knative.dev \ --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 220e6402c..66416753b 100644 --- a/test/gracefulshutdown/gracefulshutdown_test.go +++ b/test/gracefulshutdown/gracefulshutdown_test.go @@ -24,7 +24,6 @@ import ( "errors" "fmt" "io" - "log" "net/http" "net/url" "os" @@ -164,7 +163,8 @@ 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) && errURL.Unwrap() == io.EOF { + // When the gateway cuts the connection (after completing the drain process), an EOF error is returned to the client + if errors.As(err, &errURL) && errors.Is(errURL, io.EOF) { return 0, nil } @@ -172,7 +172,5 @@ func sendRequest(client *http.Client, name string, requestTimeout time.Duration) } defer resp.Body.Close() - log.Printf("sendRequest %s: %+v", requestTimeout, resp) - return resp.StatusCode, nil }