From 2794f56c0ab66f88137a0907c2ce9847102ea7b1 Mon Sep 17 00:00:00 2001 From: Chotiwat Chawannakul Date: Fri, 16 Feb 2024 15:09:07 -0800 Subject: [PATCH] Revert "use MustPassRepeatedly" This reverts commit d344404577878e124c5c8fbae46207bfa6aea868. --- test/e2e/settings/ssl_passthrough.go | 80 +++++++++++++++------------- 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/test/e2e/settings/ssl_passthrough.go b/test/e2e/settings/ssl_passthrough.go index 2421d4a90..bde53c557 100644 --- a/test/e2e/settings/ssl_passthrough.go +++ b/test/e2e/settings/ssl_passthrough.go @@ -220,48 +220,56 @@ var _ = framework.IngressNginxDescribe("[Flag] enable-ssl-passthrough", func() { } tries := 3 - ginkgo.It("should handle known traffic without Host header", ginkgo.MustPassRepeatedly(tries), func() { - f.HTTPTestClientWithTLSConfig(tlsConfig). - GET("/"). - WithURL(url). - ForceResolve(f.GetNginxIP(), 443). - WithDialContextMiddleware(throttleMiddleware). - Expect(). - Status(http.StatusOK) + ginkgo.It("should handle known traffic without Host header", func() { + for i := 0; i < tries; i++ { + f.HTTPTestClientWithTLSConfig(tlsConfig). + GET("/"). + WithURL(url). + ForceResolve(f.GetNginxIP(), 443). + WithDialContextMiddleware(throttleMiddleware). + Expect(). + Status(http.StatusOK) + } }) - ginkgo.It("should handle insecure traffic without Host header", ginkgo.MustPassRepeatedly(tries), func() { - //nolint:gosec // Ignore the gosec error in testing - f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}). - GET("/"). - WithURL(url). - ForceResolve(f.GetNginxIP(), 443). - WithDialContextMiddleware(throttleMiddleware). - Expect(). - Status(http.StatusOK) + ginkgo.It("should handle insecure traffic without Host header", func() { + for i := 0; i < tries; i++ { + //nolint:gosec // Ignore the gosec error in testing + f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}). + GET("/"). + WithURL(url). + ForceResolve(f.GetNginxIP(), 443). + WithDialContextMiddleware(throttleMiddleware). + Expect(). + Status(http.StatusOK) + } }) - ginkgo.It("should handle known traffic with Host header", ginkgo.MustPassRepeatedly(tries), func() { - f.HTTPTestClientWithTLSConfig(tlsConfig). - GET("/"). - WithURL(url). - WithHeader("Host", host). - ForceResolve(f.GetNginxIP(), 443). - WithDialContextMiddleware(throttleMiddleware). - Expect(). - Status(http.StatusOK) + ginkgo.It("should handle known traffic with Host header", func() { + for i := 0; i < tries; i++ { + f.HTTPTestClientWithTLSConfig(tlsConfig). + GET("/"). + WithURL(url). + WithHeader("Host", host). + ForceResolve(f.GetNginxIP(), 443). + WithDialContextMiddleware(throttleMiddleware). + Expect(). + Status(http.StatusOK) + } }) - ginkgo.It("should handle insecure traffic with Host header", ginkgo.MustPassRepeatedly(tries), func() { - //nolint:gosec // Ignore the gosec error in testing - f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}). - GET("/"). - WithURL(url). - WithHeader("Host", host). - ForceResolve(f.GetNginxIP(), 443). - WithDialContextMiddleware(throttleMiddleware). - Expect(). - Status(http.StatusOK) + ginkgo.It("should handle insecure traffic with Host header", func() { + for i := 0; i < tries; i++ { + //nolint:gosec // Ignore the gosec error in testing + f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}). + GET("/"). + WithURL(url). + WithHeader("Host", host). + ForceResolve(f.GetNginxIP(), 443). + WithDialContextMiddleware(throttleMiddleware). + Expect(). + Status(http.StatusOK) + } }) }) })