@@ -404,10 +404,12 @@ func (s *IntegrationTestSuite) TestServiceTrafficPolicyLocal() {
404
404
// ten responses with the expected address come back.
405
405
assertPrefix := func (addr string , prefix * netip.Prefix ) {
406
406
url := fmt .Sprintf ("http://%s" , addr )
407
- successful := 0
407
+ successes := 0
408
+ successesRequired := 15
408
409
start := time .Now ()
410
+ timeout := 120
409
411
410
- for i := 0 ; i < 120 ; i ++ {
412
+ for i := 0 ; i < timeout ; i ++ {
411
413
time .Sleep (1 * time .Second )
412
414
413
415
peer , err := testkit .HTTPRead (url )
@@ -424,15 +426,23 @@ func (s *IntegrationTestSuite) TestServiceTrafficPolicyLocal() {
424
426
continue
425
427
}
426
428
427
- successful ++
429
+ successes ++
428
430
429
- if successful >= 15 {
431
+ if successes >= successesRequired {
430
432
break
431
433
}
432
434
}
433
435
434
- s .T ().Logf ("Took %s too %s to get ready" , url , time .Since (start ))
435
- s .Require ().GreaterOrEqual (successful , 15 )
436
+ took := time .Since (start ).Round (time .Second )
437
+
438
+ if successes >= successesRequired {
439
+ s .T ().Logf ("Took %s %s to get ready" , url , took )
440
+ } else {
441
+ s .T ().Logf ("Took %s too long to get ready (%s)" , url , took )
442
+ s .T ().Logf ("CCM Logs: \n %s" , s .CCMLogs (start ))
443
+ }
444
+
445
+ s .Require ().GreaterOrEqual (successes , successesRequired )
436
446
}
437
447
438
448
// Ensures the traffic is handled without unexpected delay
0 commit comments