From d76d5c3587646ab2e5ae7134c340f88a0f350b9c Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Fri, 27 Mar 2015 10:53:18 +0000 Subject: [PATCH] Tests: Make sleeptime in wait_conditional an argument --- test/basetest/utils.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/basetest/utils.py b/test/basetest/utils.py index 0d8df97c1..b8833003a 100644 --- a/test/basetest/utils.py +++ b/test/basetest/utils.py @@ -71,15 +71,13 @@ def binary_location(cmd, USE_PATH=False): 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 """ - if timeout is None: - timeout = 1 - # NOTE Increasing sleeptime can dramatically increase testsuite runtime # It also reduces CPU load significantly - sleeptime = .01 + if timeout is None: + timeout = 1 if timeout < sleeptime: print("Warning, timeout cannot be smaller than", sleeptime)