Update to reruns + timeouts in run_test.py (#100412)
https://github.com/pytorch/pytorch/pull/100200/files made unknown tests more likely to fail b/c lacking test times but still have time outs, so fix that
Pull Request resolved: https://github.com/pytorch/pytorch/pull/100412
Approved by: https://github.com/huydhn
diff --git a/test/run_test.py b/test/run_test.py
index 9024031..6395399 100755
--- a/test/run_test.py
+++ b/test/run_test.py
@@ -547,7 +547,13 @@
command = (launcher_cmd or []) + executable + argv
should_file_rerun = "--subprocess" not in command and not RERUN_DISABLED_TESTS
- timeout = THRESHOLD * 3 if should_file_rerun else None
+ timeout = (
+ THRESHOLD * 3
+ if should_file_rerun
+ and isinstance(test_module, ShardedTest)
+ and test_module.time is not None
+ else None
+ )
print_to_stderr("Executing {} ... [{}]".format(command, datetime.now()))
with open(log_path, "w") as f: