Skip to content

Commit 2e2afde

Browse files
committed
Do not skip if exited properly
1 parent fcc90c8 commit 2e2afde

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

mmengine/testing/_internal/distributed.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def __init__(self, method_name: str = 'runTest') -> None:
101101
if method_name != 'runTest':
102102
# we allow instantiation with no explicit method name
103103
# but not an *incorrect* or missing method name
104-
raise ValueError(f"no such test method in {self.__class__}: {method_name}") from e
104+
raise ValueError(f'no such test method in {self.__class__}: {method_name}') from e
105105

106106
def setUp(self) -> None:
107107
super().setUp()
@@ -351,12 +351,13 @@ def _check_return_codes(self, elapsed_time) -> None:
351351
if first_process.exitcode == skip.exit_code:
352352
raise unittest.SkipTest(skip.message)
353353

354-
# Skip the unittest since the raised error maybe not caused by
355-
# the tested function. For example, in CI environment, the tested
356-
# method could be terminated by system signal for the limited
357-
# resources.
358-
self.skipTest(f'Skip test {self._testMethodName} due to '
359-
'the program abort')
354+
if first_process.exitcode != 0:
355+
# Skip the unittest since the raised error maybe not caused by
356+
# the tested function. For example, in CI environment, the tested
357+
# method could be terminated by system signal for the limited
358+
# resources.
359+
self.skipTest(f'Skip test {self._testMethodName} due to '
360+
'the program abort')
360361

361362
@property
362363
def is_master(self) -> bool:

0 commit comments

Comments
 (0)