Skip to content

Commit db4507d

Browse files
committed
Fix compatibility_test.go to wait for Operator Pod to be ready
1 parent ceef177 commit db4507d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/e2e/compatibility/compatibility_test.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,17 @@ func TestCompatibility(t *testing.T) {
3838
// Install a Coherence deployment
3939
d, err := helper.NewSingleCoherenceFromYaml(ns, "coherence.yaml")
4040
g.Expect(err).NotTo(HaveOccurred())
41-
err = testContext.Client.Create(context.TODO(), &d)
41+
42+
err = nil
43+
for i := 0; i < 10; i++ {
44+
err = testContext.Client.Create(context.TODO(), &d)
45+
if err == nil {
46+
break
47+
}
48+
t.Logf("Coherence cluster install failed, will retry in 5 seconds: %s", err.Error())
49+
time.Sleep(5 * time.Second)
50+
}
51+
4252
g.Expect(err).NotTo(HaveOccurred())
4353
stsBefore := assertDeploymentEventuallyInDesiredState(t, d, d.GetReplicas())
4454

@@ -88,6 +98,8 @@ func InstallPreviousVersion(g *GomegaWithT, ns, name, version, selector string)
8898
pods, err := helper.WaitForPodsWithSelector(testContext, ns, selector, time.Second*10, time.Minute*5)
8999
g.Expect(err).NotTo(HaveOccurred())
90100
g.Expect(len(pods)).To(Equal(1))
101+
err = helper.WaitForPodReady(testContext.KubeClient, ns, pods[0].Name, time.Second*10, time.Minute*5)
102+
g.Expect(err).NotTo(HaveOccurred())
91103
}
92104

93105
func InstallCurrentVersion(g *GomegaWithT, ns, name string) {
@@ -106,6 +118,8 @@ func InstallCurrentVersion(g *GomegaWithT, ns, name string) {
106118
pods, err := helper.WaitForOperatorPods(testContext, ns, time.Second*10, time.Minute*5)
107119
g.Expect(err).NotTo(HaveOccurred())
108120
g.Expect(len(pods)).To(Equal(1))
121+
err = helper.WaitForPodReady(testContext.KubeClient, ns, pods[0].Name, time.Second*10, time.Minute*5)
122+
g.Expect(err).NotTo(HaveOccurred())
109123
}
110124

111125
func CleanupBlind(t *testing.T, namespace, name string) {

0 commit comments

Comments
 (0)