Fix DC's MinReadySeconds test
package deployments
import (
- //"errors"
+ "errors"
"fmt"
"math/rand"
"strings"
@@ -934,31 +934,22 @@ var _ = g.Describe("deploymentconfigs", func() {
return true, nil
}
- // FIXME: There is a race between deployer pod updating phase and RC updating AvailableReplicas
- // FIXME: Enable this when we switch pod acceptors to use RC AvailableReplicas with MinReadySecondsSet
- //if deployutil.DeploymentStatusFor(rc) == deployapi.DeploymentStatusComplete {
- // e2e.Logf("Failed RC: %#v", rc)
- // return false, errors.New("deployment shouldn't be completed before ReadyReplicas become AvailableReplicas")
- //}
+ if deployutil.DeploymentStatusFor(rc) == deployapi.DeploymentStatusComplete {
+ e2e.Logf("Failed RC: %#v", rc)
+ return false, errors.New("deployment shouldn't be completed before ReadyReplicas become AvailableReplicas")
+ }
return false, nil
})
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(rc1.Status.AvailableReplicas).To(o.Equal(dc.Spec.Replicas))
- // FIXME: There is a race between deployer pod updating phase and RC updating AvailableReplicas
- // FIXME: Enable this when we switch pod acceptors to use RC AvailableReplicas with MinReadySecondsSet
- //// Deployment status can't be updated yet but should be right after
- //o.Expect(deployutil.DeploymentStatusFor(rc1)).To(o.Equal(deployapi.DeploymentStatusRunning))
- // It should finish right after
- // FIXME: remove this condition when the above is fixed
- if deployutil.DeploymentStatusFor(rc1) != deployapi.DeploymentStatusComplete {
- // FIXME: remove this assertion when the above is fixed
+ // Deployment status can't be updated yet but should be right after
o.Expect(deployutil.DeploymentStatusFor(rc1)).To(o.Equal(deployapi.DeploymentStatusRunning))
+ // It should finish right after
rc1, err = waitForRCModification(oc, namespace, rc1.Name, deploymentChangeTimeout,
rc1.GetResourceVersion(), func(rc *kapiv1.ReplicationController) (bool, error) {
return deployutil.DeploymentStatusFor(rc) == deployapi.DeploymentStatusComplete, nil
})
o.Expect(err).NotTo(o.HaveOccurred())
- }
// We might check that minReadySecond passed between pods becoming ready
// and available but I don't think there is a way to get a timestamp from events
