Description of problem: Currently the code @ ovirtlago/testlib.py is: 143 def assert_true_within(func, timeout): 144 with utils.EggTimer(timeout) as timer: 145 while not timer.elapsed(): 146 try: 147 if func(): 148 return 149 except Exception: 150 pass 151 raise AssertionError('Timed out') Specifically, there is a tight loop there, which consumes CPU needlessly - occupying both the client and the target of func() (for example, checking something on the engine). Simple patch: 23 import time ... 144 def assert_true_within(func, timeout): 145 with utils.EggTimer(timeout) as timer: 146 while not timer.elapsed(): 147 try: 148 if func(): 149 return 150 time.sleep(1) 151 except Exception: 152 pass 153 raise AssertionError('Timed out') solves this, by adding a 1 sec. sleep between retries (practically, can even extend to 3 or 5 seconds). Version-Release number of selected component (if applicable): 0.5
https://gerrit.ovirt.org/#/c/51568/ implements this little change.