[PATCH 1/2] test: add command to 'Lab failure' timeout message

When a timeout occurs while executing a command a 'Lab failure' message is written and testing is stopped. The user is left in the dark about the failure cause.
! _pytest.outcomes.Exit: Lab failure: Marking connection bad - no other tests will run !
Add the word 'Timeout' and the executed command to the message.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com --- test/py/u_boot_console_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py index fa9cd57b04b..070ad28ecc9 100644 --- a/test/py/u_boot_console_base.py +++ b/test/py/u_boot_console_base.py @@ -342,8 +342,8 @@ class ConsoleBase(object): # indentation. return self.p.before.strip('\r\n') except Timeout as exc: - handle_exception(self.config, self, self.log, exc, 'Lab failure', - True) + handle_exception(self.config, self, self.log, exc, + f"Lab failure: Timeout executing '{cmd}'", True) raise except BootFail as exc: handle_exception(self.config, self, self.log, exc, 'Boot fail',

When a timeout occurs while executing a command a 'Boot fail' message is written and testing is stopped. The user is left in the dark about the failure cause.
! _pytest.outcomes.Exit: Boot fail: Marking connection bad - no other tests will run !
Add the executed command to the message.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com --- test/py/u_boot_console_base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py index 070ad28ecc9..7eaceb39d9d 100644 --- a/test/py/u_boot_console_base.py +++ b/test/py/u_boot_console_base.py @@ -346,7 +346,8 @@ class ConsoleBase(object): f"Lab failure: Timeout executing '{cmd}'", True) raise except BootFail as exc: - handle_exception(self.config, self, self.log, exc, 'Boot fail', + handle_exception(self.config, self, self.log, exc, + f"'Boot fail '{cmd}'", True, self.get_spawn_output()) raise finally:

On Sat, 23 Nov 2024 at 14:29, Heinrich Schuchardt heinrich.schuchardt@canonical.com wrote:
When a timeout occurs while executing a command a 'Lab failure' message is written and testing is stopped. The user is left in the dark about the failure cause.
! _pytest.outcomes.Exit: Lab failure: Marking connection bad - no other tests will run !
Add the word 'Timeout' and the executed command to the message.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
test/py/u_boot_console_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Sat, 23 Nov 2024 22:29:21 +0100, Heinrich Schuchardt wrote:
When a timeout occurs while executing a command a 'Lab failure' message is written and testing is stopped. The user is left in the dark about the failure cause.
! _pytest.outcomes.Exit: Lab failure: Marking connection bad - no other tests will run !
Add the word 'Timeout' and the executed command to the message.
[...]
Applied to u-boot/next, thanks!
participants (3)
-
Heinrich Schuchardt
-
Simon Glass
-
Tom Rini