diff --git a/goth/assertions/assertions.py b/goth/assertions/assertions.py index 2bddef0d..ca3874b5 100644 --- a/goth/assertions/assertions.py +++ b/goth/assertions/assertions.py @@ -33,7 +33,6 @@ class EventStream(Protocol, AsyncIterable[E]): events_ended: bool """`True` iff there will be no more events.""" - else: EventStream = AsyncIterable @@ -152,7 +151,7 @@ async def func_wrapper(): try: return await self._func(self) except asyncio.CancelledError: - raise AssertionError("Assertion cancelled") + raise AssertionError(f"Assertion cancelled: {self}") finally: self._notify_update_events() diff --git a/goth/runner/probe/__init__.py b/goth/runner/probe/__init__.py index cfca122f..06d63a14 100644 --- a/goth/runner/probe/__init__.py +++ b/goth/runner/probe/__init__.py @@ -394,9 +394,12 @@ async def run_command_on_host( logger.debug("Command task has finished") except Exception as e: - logger.error(f"Cancelling command on error: {e!r}") + logger.error(f"Cancelling command on error: {e!r}, command: `{command}`") if cmd_task and not cmd_task.done(): cmd_task.cancel() + import traceback + + traceback.print_exc() raise finally: