Skip to content

Add print message when UT is failed with segmentation fault #1750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/xpu/extended/run_test_with_skip.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@
test_command = "pytest --timeout 600 -v --junit-xml=./op_extended.xml test_ops_xpu.py"
test_command += skip_options
res = os.system(test_command)
if res:
print("test_ops_xpu.py has failures in extended unit tests")
sys.exit(res)
2 changes: 2 additions & 0 deletions test/xpu/extended/run_test_with_skip_arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@
test_command = "pytest -v test_ops_xpu.py"
test_command += skip_options
res = os.system(test_command)
if res:
print("test_ops_xpu.py has failures in extended unit tests")
sys.exit(res)
2 changes: 2 additions & 0 deletions test/xpu/extended/run_test_with_skip_bmg.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@
os.environ["PYTORCH_TEST_WITH_SLOW"] = "1"
test_command = ["-k", skip_options, "test_ops_xpu.py", "-v"]
res = pytest.main(test_command)
if res:
print("test_ops_xpu.py has failures in extended UT")
sys.exit(res)
2 changes: 2 additions & 0 deletions test/xpu/extended/run_test_with_skip_lnl.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@
os.environ["PYTORCH_TEST_WITH_SLOW"] = "1"
test_command = ["-k", skip_options, "test_ops_xpu.py", "-v"]
res = pytest.main(test_command)
if res:
print("test_ops_xpu.py has failures in extended UT")
sys.exit(res)
2 changes: 2 additions & 0 deletions test/xpu/extended/run_test_with_skip_mtl.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@
os.environ["PYTORCH_TEST_WITH_SLOW"] = "1"
test_command = ["-k", skip_options, "test_ops_xpu.py", "-v"]
res = pytest.main(test_command)
if res:
print("test_ops_xpu.py" + " have failures in extended UT")
sys.exit(res)
4 changes: 3 additions & 1 deletion test/xpu/run_test_with_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def launch_test(test_case, skip_list=None, exe_list=None):
"test_comprehensive_nn_functional_nll_loss_xpu_float64",
"bincount",
)
res += launch_test("test_decomp_xpu.py", exe_list=execute_list)
res = launch_test("test_decomp_xpu.py", exe_list=execute_list)
if res:
print("test_decomp_xpu.py" + " have failures in run_test_with_only.py")

if os.name == "nt":
sys.exit(res)
Expand Down
9 changes: 8 additions & 1 deletion test/xpu/run_test_with_skip_arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from xpu_test_utils import launch_test

res = 0
fail_test = []
IS_WINDOWS = sys.platform == "win32"

for key in skip_dict:
Expand All @@ -18,7 +19,13 @@
skip_list += skip_dict_win[key]
if IS_WINDOWS and key in skip_dict_win_arc:
skip_list += skip_dict_win_arc[key]
res += launch_test(key, skip_list)
fail = launch_test(key, skip_list)
res += fail
if fail:
fail_test.append(key)

if fail_test:
print(",".join(fail_test) + " have failures")

if os.name == "nt":
sys.exit(res)
Expand Down
9 changes: 8 additions & 1 deletion test/xpu/run_test_with_skip_bmg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from xpu_test_utils import launch_test

res = 0
fail_test = []
IS_WINDOWS = sys.platform == "win32"

for key in skip_dict:
Expand All @@ -15,7 +16,13 @@
skip_list += skip_dict_win[key]
if IS_WINDOWS and key in skip_dict_win_bmg:
skip_list += skip_dict_win_bmg[key]
res += launch_test(key, skip_list)
fail = launch_test(key, skip_list)
res += fail
if fail:
fail_test.append(key)

if fail_test:
print(",".join(fail_test) + " have failures")

if os.name == "nt":
sys.exit(res)
Expand Down
9 changes: 8 additions & 1 deletion test/xpu/run_test_with_skip_lnl.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from xpu_test_utils import launch_test

res = 0
fail_test = []
IS_WINDOWS = sys.platform == "win32"

for key in skip_dict:
Expand All @@ -15,7 +16,13 @@
skip_list += skip_dict_win[key]
if IS_WINDOWS and key in skip_dict_win_lnl:
skip_list += skip_dict_win_lnl[key]
res += launch_test(key, skip_list)
fail = launch_test(key, skip_list)
res += fail
if fail:
fail_test.append(key)

if fail_test:
print(",".join(fail_test) + " have failures")

if os.name == "nt":
sys.exit(res)
Expand Down
9 changes: 8 additions & 1 deletion test/xpu/run_test_with_skip_mtl.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from xpu_test_utils import launch_test

res = 0
fail_test = []
IS_WINDOWS = sys.platform == "win32"

for key in skip_dict:
Expand All @@ -15,7 +16,13 @@
skip_list += skip_dict_specifical[key]
if IS_WINDOWS and key in skip_dict_win:
skip_list += skip_dict_win[key]
res += launch_test(key, skip_list)
fail = launch_test(key, skip_list)
res += fail
if fail:
fail_test.append(key)

if fail_test:
print(",".join(fail_test) + " have failures")

if os.name == "nt":
sys.exit(res)
Expand Down