Skip to content

Commit

Permalink
auto-t: sleep in wait_for_async_op
Browse files Browse the repository at this point in the history
This was using a lambda function as input which runs much too fast
for UML to advance the time. Change this to sleep for 100ms between
each check.

This fixes the random hang in testNetconfig.
  • Loading branch information
jprestwo authored and IWDTestBot committed Aug 22, 2022
1 parent 14addc5 commit cd80816
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion autotests/util/iwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,14 @@ def _failure(self, ex):
self._exception = _convert_dbus_ex(ex)

def _wait_for_async_op(self):
ctx.non_block_wait(lambda s: s._is_completed, 30, self, exception=None)
def check_complete(s):
if s._is_completed:
return True

time.sleep(0.1)
return False

ctx.non_block_wait(check_complete, 30, self, exception=None)

self._is_completed = False
if self._exception is not None:
Expand Down

0 comments on commit cd80816

Please sign in to comment.