Skip to content

Commit

Permalink
chore: do not sleep in e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: zachaller <[email protected]>
  • Loading branch information
zachaller committed Feb 8, 2023
1 parent 7fd92f5 commit d70ad3e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions test/e2e/experiment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ type ExperimentSuite struct {

// TestRolloutWithExperimentAndAnalysis this tests the ability for a rollout to launch an experiment,
// and use self-referencing features/pass metadata arguments to the experiment and analysis, such as:
// * specRef: stable
// * specRef: canary
// * valueFrom.podTemplateHashValue: Stable
// * valueFrom.podTemplateHashValue: Latest
// * templates.XXXXX.podTemplateHash
// - specRef: stable
// - specRef: canary
// - valueFrom.podTemplateHashValue: Stable
// - valueFrom.podTemplateHashValue: Latest
// - templates.XXXXX.podTemplateHash
func (s *ExperimentSuite) TestRolloutWithExperimentAndAnalysis() {
s.T().Parallel()
s.Given().
Expand Down Expand Up @@ -87,13 +87,17 @@ func (s *ExperimentSuite) TestExperimentWithServiceAndScaleDownDelay() {
g.ApplyManifests("@functional/experiment-with-service.yaml")
g.When().
WaitForExperimentPhase("experiment-with-service", "Running").
Sleep(time.Second*5).
WaitForExperimentCondition("experiment-with-service", func(ex *rov1.Experiment) bool {
return s.GetReplicaSetFromExperiment(ex, "test").Status.Replicas == 1
}, "number-of-rs-pods-meet", fixtures.E2EWaitTimeout).
Then().
ExpectExperimentTemplateReplicaSetNumReplicas("experiment-with-service", "test", 1).
ExpectExperimentServiceCount("experiment-with-service", 1).
When().
WaitForExperimentPhase("experiment-with-service", "Successful").
Sleep(time.Second*15).
WaitForExperimentCondition("experiment-with-service", func(ex *rov1.Experiment) bool {
return s.GetReplicaSetFromExperiment(ex, "test").Status.Replicas == 0
}, "number-of-rs-pods-meet", fixtures.E2EWaitTimeout).
Then().
ExpectExperimentTemplateReplicaSetNumReplicas("experiment-with-service", "test", 0).
ExpectExperimentServiceCount("experiment-with-service", 0)
Expand Down

0 comments on commit d70ad3e

Please sign in to comment.