Skip to content

Commit

Permalink
Added checking for CancelledError in YAML runner (#28693)
Browse files Browse the repository at this point in the history
  • Loading branch information
rquidute authored and pull[bot] committed Jan 26, 2024
1 parent fa48f10 commit d61ea97
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/py_matter_yamltests/matter_yamltests/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import asyncio
import time
from abc import ABC, abstractmethod
from asyncio import CancelledError
from dataclasses import dataclass, field

from .adapter import TestAdapter
Expand Down Expand Up @@ -144,7 +145,7 @@ async def run(self, parser_builder_config: TestParserBuilderConfig, runner_confi
continue

result = await self._run_with_timeout(parser, runner_config)
if isinstance(result, Exception):
if isinstance(result, Exception) or isinstance(result, CancelledError):
raise (result)
elif not result:
return False
Expand All @@ -160,7 +161,7 @@ async def _run_with_timeout(self, parser: TestParser, config: TestRunnerConfig):
try:
await self.start()
status = await asyncio.wait_for(self._run(parser, config), parser.timeout)
except Exception as exception:
except (Exception, CancelledError) as exception:
status = exception
finally:
await self.stop()
Expand Down

0 comments on commit d61ea97

Please sign in to comment.