Skip to content

Commit

Permalink
Add option to tune test run retries after failure
Browse files Browse the repository at this point in the history
This change adds the --retries option for having facility to tune the
number of test run retries after a failure. Previously, this value could
not be overridden and such behaviour was inconvenient while developing a
new test (when test often fails and is under debugging).

Closes #334
  • Loading branch information
ylobankov committed Apr 5, 2022
1 parent f63d85e commit 0748444
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/options.py
Expand Up @@ -205,6 +205,14 @@ def __init__(self):
2 x CPU count). -1 means everything running consistently
(single process). """)

parser.add_argument(
"-r", "--retries",
dest='retries_count',
default=env_int('TEST_RUN_RETRIES', 3),
type=int,
help="""The number of test run retries after a failure.
Default: ${TEST_RUN_RETRIES} or 3.""")

parser.add_argument(
"--reproduce",
dest="reproduce",
Expand Down
2 changes: 1 addition & 1 deletion lib/test_suite.py
Expand Up @@ -46,7 +46,7 @@ class TestSuite:
tests and other suite properties. The server is started once per
suite."""

RETRIES_COUNT = 3
RETRIES_COUNT = Options().args.retries_count

def get_multirun_conf(self, suite_path):
conf_name = self.ini.get('config', None)
Expand Down

0 comments on commit 0748444

Please sign in to comment.