Skip to content

Commit

Permalink
Fix DC's MinReadySeconds test
Browse files Browse the repository at this point in the history
  • Loading branch information
tnozicka committed Jun 29, 2017
1 parent 79b7e6c commit 4c932ab
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions test/extended/deployments/deployments.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package deployments

import (
//"errors"
"errors"
"fmt"
"math/rand"
"strings"
Expand Down Expand Up @@ -932,31 +932,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))
// 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
o.Expect(deployutil.DeploymentStatusFor(rc1)).To(o.Equal(deployapi.DeploymentStatusRunning))
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())
}
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
Expand Down

0 comments on commit 4c932ab

Please sign in to comment.