@@ -907,6 +907,8 @@ var _ = g.Describe("deploymentconfigs", func() {
907
907
// FIXME: remove when tests are migrated to the new client
908
908
// (the old one incorrectly translates nil into an empty array)
909
909
dc .Spec .Triggers = append (dc .Spec .Triggers , deployapi.DeploymentTriggerPolicy {Type : deployapi .DeploymentTriggerOnConfigChange })
910
+ // This is the last place we can safely say that the time was taken before replicas became ready
911
+ startTime := time .Now ()
910
912
dc , err = oc .Client ().DeploymentConfigs (namespace ).Create (dc )
911
913
o .Expect (err ).NotTo (o .HaveOccurred ())
912
914
@@ -927,6 +929,8 @@ var _ = g.Describe("deploymentconfigs", func() {
927
929
})
928
930
o .Expect (err ).NotTo (o .HaveOccurred ())
929
931
o .Expect (rc1 .Status .AvailableReplicas ).To (o .BeZero ())
932
+ // We need to log here to have a timestamp to compare with master logs if something goes wrong
933
+ e2e .Logf ("All replicas are ready." )
930
934
931
935
g .By ("verifying that the deployment is still running" )
932
936
if deployutil .IsTerminatedDeployment (rc1 ) {
@@ -935,7 +939,7 @@ var _ = g.Describe("deploymentconfigs", func() {
935
939
936
940
g .By ("waiting for the deployment to finish" )
937
941
rc1 , err = waitForRCModification (oc , namespace , rc1 .Name ,
938
- deploymentChangeTimeout + time .Duration (dc .Spec .MinReadySeconds )* time .Second ,
942
+ deploymentRunTimeout + time .Duration (dc .Spec .MinReadySeconds )* time .Second ,
939
943
rc1 .GetResourceVersion (), func (rc * kapiv1.ReplicationController ) (bool , error ) {
940
944
if rc .Status .AvailableReplicas == dc .Spec .Replicas {
941
945
return true , nil
@@ -947,7 +951,11 @@ var _ = g.Describe("deploymentconfigs", func() {
947
951
}
948
952
return false , nil
949
953
})
954
+ // We need to log here to have a timestamp to compare with master logs if something goes wrong
955
+ e2e .Logf ("Finished waiting for deployment." )
950
956
o .Expect (err ).NotTo (o .HaveOccurred ())
957
+ o .Expect (time .Since (startTime )).To (o .BeNumerically (">=" , time .Duration (dc .Spec .MinReadySeconds )* time .Second ),
958
+ "Deployment shall not finish before MinReadySeconds elapse." )
951
959
o .Expect (rc1 .Status .AvailableReplicas ).To (o .Equal (dc .Spec .Replicas ))
952
960
// Deployment status can't be updated yet but should be right after
953
961
o .Expect (deployutil .DeploymentStatusFor (rc1 )).To (o .Equal (deployapi .DeploymentStatusRunning ))
0 commit comments