Add retry logic for scheduled CI tests (#14771)
This commit is contained in:
@@ -136,6 +136,9 @@ def run_a_suite(args):
|
||||
test_files,
|
||||
timeout_per_file=args.timeout_per_file,
|
||||
continue_on_error=args.continue_on_error,
|
||||
enable_retry=args.enable_retry,
|
||||
max_attempts=args.max_attempts,
|
||||
retry_wait_seconds=args.retry_wait_seconds,
|
||||
)
|
||||
|
||||
|
||||
@@ -178,6 +181,24 @@ def main():
|
||||
type=int,
|
||||
help="Use auto load balancing. The number of parts.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--enable-retry",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Enable smart retry for accuracy/performance assertion failures (not code errors)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--max-attempts",
|
||||
type=int,
|
||||
default=2,
|
||||
help="Maximum number of attempts per file including initial run (default: 2)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--retry-wait-seconds",
|
||||
type=int,
|
||||
default=60,
|
||||
help="Seconds to wait between retries (default: 60)",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
# Validate auto-partition arguments
|
||||
|
||||
+26
-1
@@ -511,6 +511,24 @@ def main():
|
||||
default=False,
|
||||
help="Continue running remaining tests even if one fails (useful for nightly tests)",
|
||||
)
|
||||
arg_parser.add_argument(
|
||||
"--enable-retry",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Enable smart retry for accuracy/performance assertion failures (not code errors)",
|
||||
)
|
||||
arg_parser.add_argument(
|
||||
"--max-attempts",
|
||||
type=int,
|
||||
default=2,
|
||||
help="Maximum number of attempts per file including initial run (default: 2)",
|
||||
)
|
||||
arg_parser.add_argument(
|
||||
"--retry-wait-seconds",
|
||||
type=int,
|
||||
default=60,
|
||||
help="Seconds to wait between retries (default: 60)",
|
||||
)
|
||||
args = arg_parser.parse_args()
|
||||
print(f"{args=}")
|
||||
|
||||
@@ -526,7 +544,14 @@ def main():
|
||||
|
||||
print("The running tests are ", [f.name for f in files])
|
||||
|
||||
exit_code = run_unittest_files(files, args.timeout_per_file, args.continue_on_error)
|
||||
exit_code = run_unittest_files(
|
||||
files,
|
||||
args.timeout_per_file,
|
||||
args.continue_on_error,
|
||||
enable_retry=args.enable_retry,
|
||||
max_attempts=args.max_attempts,
|
||||
retry_wait_seconds=args.retry_wait_seconds,
|
||||
)
|
||||
exit(exit_code)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user