Skip to content

Commit 704b949

Browse files
author
Kate Osborn
committed
Increase test for traffic timeout
1 parent ff25300 commit 704b949

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

tests/framework/timeout.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ type TimeoutConfig struct {
3232

3333
// GetStatusTimeout represents the maximum time for NGF to update the status of a resource.
3434
GetStatusTimeout time.Duration
35+
36+
// TestForTrafficTimeout represents the maximum time for NGF to test for passing or failing traffic.
37+
TestForTrafficTimeout time.Duration
3538
}
3639

3740
// DefaultTimeoutConfig populates a TimeoutConfig with the default values.
@@ -47,5 +50,6 @@ func DefaultTimeoutConfig() TimeoutConfig {
4750
ContainerRestartTimeout: 10 * time.Second,
4851
GetLeaderLeaseTimeout: 60 * time.Second,
4952
GetStatusTimeout: 60 * time.Second,
53+
TestForTrafficTimeout: 60 * time.Second,
5054
}
5155
}

tests/suite/graceful_recovery_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var _ = Describe("Graceful Recovery test", Ordered, Label("graceful-recovery"),
8282
func() error {
8383
return checkForWorkingTraffic(teaURL, coffeeURL)
8484
}).
85-
WithTimeout(timeoutConfig.RequestTimeout * 2).
85+
WithTimeout(timeoutConfig.TestForTrafficTimeout).
8686
WithPolling(500 * time.Millisecond).
8787
Should(Succeed())
8888
})
@@ -287,6 +287,7 @@ func checkForFailingTraffic(teaURL, coffeeURL string) error {
287287

288288
func expectRequestToSucceed(appURL, address string, responseBodyMessage string) error {
289289
status, body, err := framework.Get(appURL, address, timeoutConfig.RequestTimeout)
290+
290291
if status != http.StatusOK {
291292
return errors.New("http status was not 200")
292293
}
@@ -320,7 +321,7 @@ func checkNGFFunctionality(teaURL, coffeeURL, ngfPodName, containerName string,
320321
func() error {
321322
return checkForWorkingTraffic(teaURL, coffeeURL)
322323
}).
323-
WithTimeout(timeoutConfig.RequestTimeout * 2).
324+
WithTimeout(timeoutConfig.TestForTrafficTimeout).
324325
WithPolling(500 * time.Millisecond).
325326
Should(Succeed())
326327

@@ -330,7 +331,7 @@ func checkNGFFunctionality(teaURL, coffeeURL, ngfPodName, containerName string,
330331
func() error {
331332
return checkForFailingTraffic(teaURL, coffeeURL)
332333
}).
333-
WithTimeout(timeoutConfig.RequestTimeout).
334+
WithTimeout(timeoutConfig.TestForTrafficTimeout).
334335
WithPolling(500 * time.Millisecond).
335336
Should(Succeed())
336337

@@ -341,7 +342,7 @@ func checkNGFFunctionality(teaURL, coffeeURL, ngfPodName, containerName string,
341342
func() error {
342343
return checkForWorkingTraffic(teaURL, coffeeURL)
343344
}).
344-
WithTimeout(timeoutConfig.RequestTimeout * 2).
345+
WithTimeout(timeoutConfig.TestForTrafficTimeout).
345346
WithPolling(500 * time.Millisecond).
346347
Should(Succeed())
347348

0 commit comments

Comments
 (0)