mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 09:53:08 +02:00
Tests: Make sleeptime in wait_conditional an argument
This commit is contained in:
parent
526665d4ec
commit
d76d5c3587
1 changed files with 3 additions and 5 deletions
|
@ -71,15 +71,13 @@ def binary_location(cmd, USE_PATH=False):
|
||||||
return os.path.join(BIN_PREFIX, cmd)
|
return os.path.join(BIN_PREFIX, cmd)
|
||||||
|
|
||||||
|
|
||||||
def wait_condition(cond, timeout=1):
|
def wait_condition(cond, timeout=1, sleeptime=.01):
|
||||||
"""Wait for condition to return anything other than None
|
"""Wait for condition to return anything other than None
|
||||||
"""
|
"""
|
||||||
if timeout is None:
|
|
||||||
timeout = 1
|
|
||||||
|
|
||||||
# NOTE Increasing sleeptime can dramatically increase testsuite runtime
|
# NOTE Increasing sleeptime can dramatically increase testsuite runtime
|
||||||
# It also reduces CPU load significantly
|
# It also reduces CPU load significantly
|
||||||
sleeptime = .01
|
if timeout is None:
|
||||||
|
timeout = 1
|
||||||
|
|
||||||
if timeout < sleeptime:
|
if timeout < sleeptime:
|
||||||
print("Warning, timeout cannot be smaller than", sleeptime)
|
print("Warning, timeout cannot be smaller than", sleeptime)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue