mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix timeout logic
This commit is contained in:
parent
517650f87b
commit
5fee7620a5
1 changed files with 2 additions and 2 deletions
|
@ -712,7 +712,7 @@ class SaltMinionEventAssertsMixin(object):
|
|||
event = self.q.get(False)
|
||||
except Empty:
|
||||
time.sleep(sleep_time)
|
||||
if start - time.time() >= timeout:
|
||||
if time.time() - start >= timeout:
|
||||
break
|
||||
continue
|
||||
if isinstance(event, dict):
|
||||
|
@ -720,7 +720,7 @@ class SaltMinionEventAssertsMixin(object):
|
|||
if desired_event == event:
|
||||
self.fetch_proc.terminate()
|
||||
return True
|
||||
if start - time.time() >= timeout:
|
||||
if time.time() - start >= timeout:
|
||||
break
|
||||
self.fetch_proc.terminate()
|
||||
raise AssertionError('Event {0} was not received by minion'.format(desired_event))
|
||||
|
|
Loading…
Add table
Reference in a new issue