Fix integration tests due to change in update flow
@@ -239,8 +239,10 @@ var _ = Describe("Deploy", func() {
_, _, err = env.UpdateBOSHDeployment(env.Namespace, *bdm)
Expect(err).NotTo(HaveOccurred())
+ // nats is a special release which consumes itself. So, whenever these is change related instances or azs
+ // nats statefulset gets updated 2 times. TODO: need to fix this later.
By("checking for instance group updated pods")
- err = env.WaitForInstanceGroup(env.Namespace, "test", "nats", "2", 1)
+ err = env.WaitForInstanceGroup(env.Namespace, "test", "nats", "3", 1)
Expect(err).NotTo(HaveOccurred(), "error waiting for instance group pods from deployment")
})
})
@@ -312,8 +314,9 @@ var _ = Describe("Deploy", func() {
err = env.WaitForInstanceGroup(env.Namespace, "test", "nats", "2", 2)
Expect(err).NotTo(HaveOccurred(), "error waiting for instance group pods from deployment")
- err = env.WaitForInstanceGroup(env.Namespace, "test", "nats", "1", 0)
- Expect(err).NotTo(HaveOccurred(), "error waiting for old pods to vanish")
+ found, err := env.StatefulSetExist(env.Namespace, "test-nats-v1")
+ Expect(found).To(BeFalse())
+ Expect(err).NotTo(HaveOccurred())
// Stop the watcher if it's still running
close(stopChan)
@@ -354,20 +357,20 @@ var _ = Describe("Deploy", func() {
scaleDeployment("2")
By("checking for instance group updated pods")
- err := env.WaitForInstanceGroup(env.Namespace, "test", "nats", "2", 2)
+ err := env.WaitForInstanceGroup(env.Namespace, "test", "nats", "3", 2)
Expect(err).NotTo(HaveOccurred(), "error waiting for instance group pods from deployment")
- pods, _ := env.GetInstanceGroupPods(env.Namespace, "test", "nats", "2")
+ pods, _ := env.GetInstanceGroupPods(env.Namespace, "test", "nats", "3")
Expect(len(pods.Items)).To(Equal(2))
By("updating the deployment again")
scaleDeployment("3")
By("checking if the deployment was again updated")
- err = env.WaitForInstanceGroup(env.Namespace, "test", "nats", "3", 3)
+ err = env.WaitForInstanceGroup(env.Namespace, "test", "nats", "5", 3)
Expect(err).NotTo(HaveOccurred(), "error waiting for pod from deployment")
- pods, _ = env.GetInstanceGroupPods(env.Namespace, "test", "nats", "3")
+ pods, _ = env.GetInstanceGroupPods(env.Namespace, "test", "nats", "5")
Expect(len(pods.Items)).To(Equal(3))
})
})
