Skip to content

Commit

Permalink
Do not skip if exited properly
Browse files Browse the repository at this point in the history
  • Loading branch information
tibor-reiss committed Oct 28, 2024
1 parent fcc90c8 commit 2d55390
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions mmengine/testing/_internal/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def __init__(self, method_name: str = 'runTest') -> None:
if method_name != 'runTest':
# we allow instantiation with no explicit method name
# but not an *incorrect* or missing method name
raise ValueError(f"no such test method in {self.__class__}: {method_name}") from e
raise ValueError(f'no such test method in {self.__class__}:'
f' {method_name}') from e

def setUp(self) -> None:
super().setUp()
Expand Down Expand Up @@ -351,12 +352,13 @@ def _check_return_codes(self, elapsed_time) -> None:
if first_process.exitcode == skip.exit_code:
raise unittest.SkipTest(skip.message)

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

@property
def is_master(self) -> bool:
Expand Down

0 comments on commit 2d55390

Please sign in to comment.