Skip to content

Commit 0ea697c

Browse files
authored
[Proton][UT] Print data in case of AssertionError to get more data and make a fix (#5450)
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
1 parent 0794e64 commit 0ea697c

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

third_party/proton/test/test_api.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -343,16 +343,21 @@ def test_state(tmp_path: pathlib.Path):
343343
with temp_file.open() as f:
344344
data = json.load(f)
345345
# test0->test1->state
346-
assert len(data[0]["children"]) == 1
347-
child = data[0]["children"][0]
348-
assert child["frame"]["name"] == "test0"
349-
assert len(child["children"]) == 1
350-
child = child["children"][0]
351-
assert child["frame"]["name"] == "test1"
352-
assert len(child["children"]) == 1
353-
child = child["children"][0]
354-
assert child["frame"]["name"] == "state"
355-
assert child["metrics"]["a"] == 1.0
346+
try:
347+
assert len(data[0]["children"]) == 1
348+
child = data[0]["children"][0]
349+
assert child["frame"]["name"] == "test0"
350+
assert len(child["children"]) == 1
351+
child = child["children"][0]
352+
assert child["frame"]["name"] == "test1"
353+
assert len(child["children"]) == 1
354+
child = child["children"][0]
355+
assert child["frame"]["name"] == "state"
356+
assert child["metrics"]["a"] == 1.0
357+
except AssertionError:
358+
# FIXME: remove this try-except block when https://github.com/intel/intel-xpu-backend-for-triton/issues/5447 will be fixed
359+
print(f"proton data: {data}")
360+
raise
356361

357362

358363
def test_context_depth(tmp_path: pathlib.Path):

0 commit comments

Comments
 (0)