Skip to content

Commit

Permalink
Fix flaky controller test (#4930)
Browse files Browse the repository at this point in the history
  • Loading branch information
SupriyaKasten authored and Ilya Kislenko committed Feb 9, 2019
1 parent 4c945f0 commit 4c38a71
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,14 @@ func (s *ControllerSuite) waitOnActionSetState(c *C, as *crv1alpha1.ActionSet, s
if as.Status.State == state {
return true, nil
}
if state == crv1alpha1.StateRunning && as.Status.State == crv1alpha1.StateComplete {
return true, nil
}
// These are non-terminal states.
if as.Status.State == crv1alpha1.StatePending || as.Status.State == crv1alpha1.StateRunning {
return false, nil
}
return false, errors.New(fmt.Sprintf("Unexpected state: %s", state))
return false, errors.New(fmt.Sprintf("Unexpected state: %s", as.Status.State))

})
if err == nil {
Expand Down

0 comments on commit 4c38a71

Please sign in to comment.