Skip to content

Commit 18d153b

Browse files
committed
Add MustPassRepeatedly to Eventually check
1 parent 9769303 commit 18d153b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tests/suite/graceful_recovery_test.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,14 @@ func runRestartNodeTest(teaURL, coffeeURL string, files []string, ns *core.Names
167167

168168
// ngf can often oscillate between ready and error, so we wait for a stable readiness in ngf
169169
var podNames []string
170-
var count int
171170
Eventually(
172171
func() bool {
173172
podNames, err = framework.GetReadyNGFPodNames(k8sClient, ngfNamespace, releaseName, timeoutConfig.GetStatusTimeout)
174-
if len(podNames) == 1 {
175-
count++
176-
return count == 20 && err == nil
177-
}
178-
count = 0
179-
return false
173+
return len(podNames) == 1 && err == nil
180174
}).
181175
WithTimeout(timeoutConfig.CreateTimeout * 2).
182176
WithPolling(500 * time.Millisecond).
177+
MustPassRepeatedly(20).
183178
Should(BeTrue())
184179

185180
ngfPodName := podNames[0]

0 commit comments

Comments
 (0)