[Concept,2/4] test/py: Use longer timeout for lab-mode restart

Message ID 20251220051013.3459855-3-sjg@u-boot.org
State New
Headers
Series Lab fixes |

Commit Message

Simon Glass Dec. 20, 2025, 5:10 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

When restarting U-Boot in lab mode, ensure_spawned() sets the timeout
to TIMEOUT_MS (30 seconds) before calling _wait_for_boot_prompt(). In
lab mode, _wait_for_banner() is skipped, so TIMEOUT_PREPARE_MS is never
restored.

This causes tests that boot into Linux and then restart U-Boot (like
test_distro_script) to fail with a timeout if the board takes more than
30 seconds to reset and boot.

Fix this by setting the timeout to TIMEOUT_PREPARE_MS (3 minutes) at
the start of _wait_for_boot_prompt() when in lab mode.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 test/py/console_base.py | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/test/py/console_base.py b/test/py/console_base.py
index 7443c567937..2bfd42746e4 100644
--- a/test/py/console_base.py
+++ b/test/py/console_base.py
@@ -309,6 +309,8 @@  class ConsoleBase():
         try:
             self.log.info('Waiting for U-Boot to be ready')
 
+            if self.lab_mode:
+                self.timeout = TIMEOUT_PREPARE_MS
             if not self.lab_mode:
                 self._wait_for_banner(loop_num)
                 self.u_boot_version_string = self.after