Skip to content

Commit 30625ae

Browse files
albanDpytorchmergebot
authored andcommitted
Add cpp stack traces to our own reruns (#119408)
Note that I'm not sure why we both have pytest rerun the failing test twice via https://github.com/pytorch/pytorch/blob/81abc2b2494ab7d48394b63d528eb5dddfa9d3d5/test/run_test.py#L966 before our own logic retries it as well? The failing test is only here to make sure it works as expected in the CI env. Will remove before landing. Pull Request resolved: #119408 Approved by: https://github.com/huydhn
1 parent 41adec3 commit 30625ae

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/run_test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
FILE_SCHEMA,
2727
get_report_path,
2828
IS_CI,
29+
IS_MACOS,
2930
parser as common_parser,
3031
retry_shell,
3132
set_cwd,
@@ -617,6 +618,16 @@ def print_to_file(s):
617618
else:
618619
sc_command = f"--sc={stepcurrent_key}"
619620
print_to_file("Retrying...")
621+
# Print full c++ stack traces during retries
622+
# Don't do it for macos inductor tests as it makes them
623+
# segfault for some reason
624+
if not (
625+
IS_MACOS
626+
and len(command) >= 2
627+
and command[2].startswith(INDUCTOR_TEST_PREFIX)
628+
):
629+
env = env or {}
630+
env["TORCH_SHOW_CPP_STACKTRACES"] = "1"
620631
print_items = [] # do not continue printing them, massive waste of space
621632

622633
consistent_failures = [x[1:-1] for x in num_failures.keys() if num_failures[x] >= 3]

0 commit comments

Comments
 (0)