Skip to content

Commit

Permalink
Fix compatibility_test.go to wait for Operator Pod to be ready
Browse files Browse the repository at this point in the history
  • Loading branch information
thegridman committed Jul 1, 2021
1 parent ceef177 commit db4507d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/e2e/compatibility/compatibility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,17 @@ func TestCompatibility(t *testing.T) {
// Install a Coherence deployment
d, err := helper.NewSingleCoherenceFromYaml(ns, "coherence.yaml")
g.Expect(err).NotTo(HaveOccurred())
err = testContext.Client.Create(context.TODO(), &d)

err = nil
for i := 0; i < 10; i++ {
err = testContext.Client.Create(context.TODO(), &d)
if err == nil {
break
}
t.Logf("Coherence cluster install failed, will retry in 5 seconds: %s", err.Error())
time.Sleep(5 * time.Second)
}

g.Expect(err).NotTo(HaveOccurred())
stsBefore := assertDeploymentEventuallyInDesiredState(t, d, d.GetReplicas())

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

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

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

0 comments on commit db4507d

Please sign in to comment.