- if debug is None or debug.lower() not in ["gdb", "gdbserver"]:
- sys.exit(run_forked(suite))
-
- # don't fork if debugging..
- sys.exit(not VppTestRunner(verbosity=verbose,
- failfast=failfast).run(suite).wasSuccessful())
+ try:
+ retries = int(os.getenv("RETRIES", 0))
+ except ValueError:
+ retries = 0
+ attempts = retries + 1
+ if attempts > 1:
+ print("Perform %s attempts to pass the suite..." % attempts)
+ if (debug is not None and debug.lower() in ["gdb", "gdbserver"]) or step:
+ # don't fork if requiring interactive terminal..
+ sys.exit(not VppTestRunner(
+ verbosity=verbose, failfast=failfast).run(suite).wasSuccessful())
+ else:
+ while True:
+ result, failed = run_forked(suite)
+ attempts = attempts - 1
+ print("%s test(s) failed, %s attempt(s) left" %
+ (len(failed), attempts))
+ if len(failed) > 0 and attempts > 0:
+ suite = suite_from_failed(suite, failed)
+ continue
+ sys.exit(result)