Skip to content

Commit 6d8a420

Browse files
committed
make chunkSize < len(host) and remove retries
1 parent 525931b commit 6d8a420

File tree

1 file changed

+33
-42
lines changed

1 file changed

+33
-42
lines changed

test/e2e/settings/ssl_passthrough.go

+33-42
Original file line numberDiff line numberDiff line change
@@ -214,62 +214,53 @@ var _ = framework.IngressNginxDescribe("[Flag] enable-ssl-passthrough", func() {
214214
conn, err := next(ctx, network, addr)
215215
return &writeThrottledConn{
216216
Conn: conn,
217-
chunkSize: 50,
217+
chunkSize: len(host) / 3,
218218
}, err
219219
}
220220
}
221-
tries := 3
222221

223222
ginkgo.It("should handle known traffic without Host header", func() {
224-
for i := 0; i < tries; i++ {
225-
f.HTTPTestClientWithTLSConfig(tlsConfig).
226-
GET("/").
227-
WithURL(url).
228-
ForceResolve(f.GetNginxIP(), 443).
229-
WithDialContextMiddleware(throttleMiddleware).
230-
Expect().
231-
Status(http.StatusOK)
232-
}
223+
f.HTTPTestClientWithTLSConfig(tlsConfig).
224+
GET("/").
225+
WithURL(url).
226+
ForceResolve(f.GetNginxIP(), 443).
227+
WithDialContextMiddleware(throttleMiddleware).
228+
Expect().
229+
Status(http.StatusOK)
233230
})
234231

235232
ginkgo.It("should handle insecure traffic without Host header", func() {
236-
for i := 0; i < tries; i++ {
237-
//nolint:gosec // Ignore the gosec error in testing
238-
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
239-
GET("/").
240-
WithURL(url).
241-
ForceResolve(f.GetNginxIP(), 443).
242-
WithDialContextMiddleware(throttleMiddleware).
243-
Expect().
244-
Status(http.StatusOK)
245-
}
233+
//nolint:gosec // Ignore the gosec error in testing
234+
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
235+
GET("/").
236+
WithURL(url).
237+
ForceResolve(f.GetNginxIP(), 443).
238+
WithDialContextMiddleware(throttleMiddleware).
239+
Expect().
240+
Status(http.StatusOK)
246241
})
247242

248243
ginkgo.It("should handle known traffic with Host header", func() {
249-
for i := 0; i < tries; i++ {
250-
f.HTTPTestClientWithTLSConfig(tlsConfig).
251-
GET("/").
252-
WithURL(url).
253-
WithHeader("Host", host).
254-
ForceResolve(f.GetNginxIP(), 443).
255-
WithDialContextMiddleware(throttleMiddleware).
256-
Expect().
257-
Status(http.StatusOK)
258-
}
244+
f.HTTPTestClientWithTLSConfig(tlsConfig).
245+
GET("/").
246+
WithURL(url).
247+
WithHeader("Host", host).
248+
ForceResolve(f.GetNginxIP(), 443).
249+
WithDialContextMiddleware(throttleMiddleware).
250+
Expect().
251+
Status(http.StatusOK)
259252
})
260253

261254
ginkgo.It("should handle insecure traffic with Host header", func() {
262-
for i := 0; i < tries; i++ {
263-
//nolint:gosec // Ignore the gosec error in testing
264-
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
265-
GET("/").
266-
WithURL(url).
267-
WithHeader("Host", host).
268-
ForceResolve(f.GetNginxIP(), 443).
269-
WithDialContextMiddleware(throttleMiddleware).
270-
Expect().
271-
Status(http.StatusOK)
272-
}
255+
//nolint:gosec // Ignore the gosec error in testing
256+
f.HTTPTestClientWithTLSConfig(&tls.Config{ServerName: host, InsecureSkipVerify: true}).
257+
GET("/").
258+
WithURL(url).
259+
WithHeader("Host", host).
260+
ForceResolve(f.GetNginxIP(), 443).
261+
WithDialContextMiddleware(throttleMiddleware).
262+
Expect().
263+
Status(http.StatusOK)
273264
})
274265
})
275266
})

0 commit comments

Comments
 (0)