dist/testrunner: make interactive test retries/delay configurable

This commit is contained in:
Alexandre Abadie 2019-12-06 11:36:13 +01:00
parent f44d9f88f0
commit 55ef046728
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
2 changed files with 9 additions and 3 deletions

View File

@ -24,6 +24,10 @@ RIOTBASE = (os.environ.get('RIOTBASE') or
# default value (3)
MAKE_TERM_STARTED_DELAY = int(os.environ.get('TESTRUNNER_START_DELAY') or 3)
# Allow customizing test interactive settings with environment variables
TEST_INTERACTIVE_RETRIES = int(os.environ.get('TEST_INTERACTIVE_RETRIES') or 5)
TEST_INTERACTIVE_DELAY = int(os.environ.get('TEST_INTERACTIVE_DELAY') or 1)
def list_until(l, cond):
return l[:([i for i, e in enumerate(l) if cond(e)][0])]
@ -79,8 +83,10 @@ def sync_child(child):
_test_utils_interactive_sync(child, modules)
def _test_utils_interactive_sync(child, modules, retries=5, delay=1):
def _test_utils_interactive_sync(child, modules):
if 'test_utils_interactive_sync' not in modules:
return
utils.test_utils_interactive_sync(child, retries=retries, delay=delay)
utils.test_utils_interactive_sync(child,
TEST_INTERACTIVE_RETRIES,
TEST_INTERACTIVE_DELAY)

View File

@ -9,7 +9,7 @@
import pexpect
def test_utils_interactive_sync(child, retries=5, delay=1):
def test_utils_interactive_sync(child, retries, delay):
"""Synchronisation for 'test_utils_interactive_sync' function.
Interacts through input to wait for node being ready.