Skip to content

Commit 49a5c1d

Browse files
authored
Improve failing test retry printing when using EMTEST_RETRY_COUNT. (#25845)
The `err` object is a two-tuple, where `err[0]` is the failing test object, and `err[1]` is the test failure error message. So print `err[1]` to show ``` [1/1] test_failing (test_core.core0.test_failing) ... ERROR common:INFO: Retrying flaky test "test_core.core0.test_failing" (attempt 1/3 failed): Traceback (most recent call last): File "C:\emsdk\emscripten\main\test\test_core.py", line 9470, in test_failing raise Exception('asdf') Exception: asdf ``` instead of ``` [1/1] test_failing (test_core.core0.test_failing) ... ERROR common:INFO: Retrying flaky test "test_core.core0.test_failing" (attempt 1/3 failed): (<test_core.core0 testMethod=test_failing>, 'Traceback (most recent call last):\n File "C:\\emsdk\\emscripten\\main\\test\\test_core.py", line 9470, in test_failing\n raise Exception(\'asdf\')\nException: asdf\n') ```
1 parent e43e97f commit 49a5c1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/retryable_unittest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ def run(self, result=None):
3434
else:
3535
raise Exception('Internal error in RetryableTestCase: did not detect an error')
3636

37-
common.record_flaky_test(self.id(), EMTEST_RETRY_COUNT - retries_left, EMTEST_RETRY_COUNT, str(err))
37+
common.record_flaky_test(self.id(), EMTEST_RETRY_COUNT - retries_left, EMTEST_RETRY_COUNT, err[1])

0 commit comments

Comments
 (0)