Avoid race condition in even assertions

This commit is contained in:
Daniel A. Wozniak 2019-04-19 04:29:39 +00:00 committed by Pedro Algarvio
parent 9443451d9a
commit 82e9ac5b8f
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -657,6 +657,14 @@ def _fetch_events(q):
atexit.register(_clean_queue)
opts = RUNTIME_VARS.RUNTIME_CONFIGS['minion']
event = salt.utils.event.get_event('minion', sock_dir=opts['sock_dir'], opts=opts)
# Wait for event bus to be connected
while not event.connect_pull(30):
time.sleep(1)
# Notify parent process that the event bus is connected
q.put('CONNECTED')
while True:
try:
events = event.get_event(full=False)