Skip to content

Commit

Permalink
Wait for the entire assert timeout for resources to be deleted. (#1169)
Browse files Browse the repository at this point in the history
* Wait for the entire assert timeout for resources to be deleted.

Previously, the test timeout was ignored when waiting for resources deleted by a TestStep to disappear. This changes it so that the test assert timeout is respected and used.

* cast int to time.Duration
  • Loading branch information
jbarrick-mesosphere committed Dec 13, 2019
1 parent bae827a commit 9981ed2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/test/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (s *Step) DeleteExisting(namespace string) error {
}

// Wait for resources to be deleted.
return wait.PollImmediate(100*time.Millisecond, 10*time.Second, func() (done bool, err error) {
return wait.PollImmediate(100*time.Millisecond, time.Duration(s.GetTimeout())*time.Second, func() (done bool, err error) {
for _, obj := range toDelete {
err = cl.Get(context.TODO(), testutils.ObjectKey(obj), obj.DeepCopyObject())
if err == nil || !k8serrors.IsNotFound(err) {
Expand Down

0 comments on commit 9981ed2

Please sign in to comment.