Fix incorrect condition in deployment rollover e2e test

This commit is contained in:
Janet Kuo 2016-01-05 16:56:12 -08:00
parent e663dbc302
commit 7d5db746bf

View File

@ -292,18 +292,13 @@ func testRolloverDeployment(f *Framework) {
deployment, err := c.Deployments(ns).Get(deploymentName)
// Make sure the deployment starts to scale up and down RCs
waitForPartialEvents(c, ns, deployment, 2)
events, err := c.Events(ns).Search(deployment)
if err != nil {
Logf("error in listing events: %s", err)
Expect(err).NotTo(HaveOccurred())
}
newRC, err := deploymentutil.GetNewRC(*deployment, c)
Expect(err).NotTo(HaveOccurred())
Expect(newRC).NotTo(Equal(nil))
// Before the deployment finishes, update the deployment to rollover the above 2 rcs and bring up redis pods.
// If the deployment already finished here, the test would fail. When this happens, increase its minReadySeconds or replicas to prevent it.
Expect(len(events.Items)).Should(BeNumerically("<", deploymentReplicas))
Expect(newRC.Spec.Replicas).Should(BeNumerically("<", deploymentReplicas))
updatedDeploymentImage := "redis"
newDeployment.Spec.Template.Spec.Containers[0].Name = updatedDeploymentImage
newDeployment.Spec.Template.Spec.Containers[0].Image = updatedDeploymentImage