topgun/k8s: reduce even more the flakiness of worker_lifecycle test
We were previously not accounting for the fact that it might take a
little while for the build to be marked as succeeded.
That race used to make our tests fail quite a good amount of times.
@@ -104,9 +104,12 @@ var _ = Describe("Worker lifecycle", func() {
Should(HaveLen(0))
By("seeing that the build succeeded")
+ Eventually(func() *gbytes.Buffer {
startSession := fly.Start("builds", "-j", "some-pipeline/simple-job")
<-startSession.Exited
- Expect(startSession.Out).To(gbytes.Say("succeeded"))
+ return startSession.Out
+ }, 1*time.Minute, 5*time.Second).
+ Should(gbytes.Say("succeeded"))
})
})
