From patchwork Sat Jan 3 20:05:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1247 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470844; bh=vQVrZ1UhmExaAvQuTUkaGGud4vmeq2gFc1Tvmw6zIWA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=X3Dhoix/lDLaDpfXG/X5nu4y943bP0U6NoyoqXaJmhKsHHkh2stBB89tSNw84s/zh 9enGDfL3T1ILVjlhwxHeALxwaGnvDuqu7ZxGBaQyIlrwoVyosFgHBD1Cs3j03OkEEk zm9GD0uUiPoN22BpJebfSdorr6LYsyRsyQczD6cVcwpsll6nOdCiPhzEHmP8joK/Q7 IMhhdK0Y978kld/XkE/gTioLcN6Qdsaqksbu+YgjUZQ1MyS13mM5JUxegpNBLUxv2S JebTBhVsR1wxC87JVEeIUho8zzebRSrEFk89LndQyfTIt+f5Nvw2sFyq7JxdneuuBH a8kiSVbHCWTRA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9234669095 for ; Sat, 3 Jan 2026 13:07:24 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id T9Hz_GhEjjxd for ; Sat, 3 Jan 2026 13:07:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470844; bh=vQVrZ1UhmExaAvQuTUkaGGud4vmeq2gFc1Tvmw6zIWA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=X3Dhoix/lDLaDpfXG/X5nu4y943bP0U6NoyoqXaJmhKsHHkh2stBB89tSNw84s/zh 9enGDfL3T1ILVjlhwxHeALxwaGnvDuqu7ZxGBaQyIlrwoVyosFgHBD1Cs3j03OkEEk zm9GD0uUiPoN22BpJebfSdorr6LYsyRsyQczD6cVcwpsll6nOdCiPhzEHmP8joK/Q7 IMhhdK0Y978kld/XkE/gTioLcN6Qdsaqksbu+YgjUZQ1MyS13mM5JUxegpNBLUxv2S JebTBhVsR1wxC87JVEeIUho8zzebRSrEFk89LndQyfTIt+f5Nvw2sFyq7JxdneuuBH a8kiSVbHCWTRA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 81F8A68FD2 for ; Sat, 3 Jan 2026 13:07:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470842; bh=9sFY14ombdZEr55J2/PN/yaaY+RJQjtGht/SqDWcx4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KMrQNwB4cUxfyPAa4U17HEIXEBrG9lLGEiycqQe3GScIjho99qMR4vp+8HThJSYgb 0/abS0Q8auKYC4WpVquAgOwKX8gMENpK5yQgIs2qz7e9qaETZQ7qdrammd5HxNpluu rVdGCKagjpSbS6ncf21ejn+2eC9sR9KRKr5ZU5QHy6CQTylX/eQuXpIF9xKbsGXvai hg4mH9vvbXwc8IYwKhc3p/CPIBL44+db9HIWcM5WYkjDZDq0x+7Stv4ZnMoPY4tJIo btUwIWbk86EvOzUul1aXaHaqvQAJmAjflfImnpAKna33/B8i8m0/fUv44ZkJsYum00 2mpwn4je2E6bQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6FC2168FCC; Sat, 3 Jan 2026 13:07:22 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id cTCGxhPZuToL; Sat, 3 Jan 2026 13:07:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767470838; bh=KpZaLYRMZlPNoiy/g+rMYI8rrcO83ebeSSFmFIdmnKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LtC8zu2FLF8wOO9heIksJnHEqsAnIIr+i8CnRnAEDE3y5bXPb+OB+EwCL1losUHvz ldy6CELGW9axHWH83WGcW8nJuJNoCmjvazWLLAjmU32Q0LiL8BizylyOlneP+pWzQl P/4z8LF4ULQLTOCWhh9jvweKKT1DpdSt2cmf5oBShoPPkRpaa7P9h8KO3Ot7WXSfjD XtHFu74LeVu+uvtdSflz4bA+4SD/XXjAAImMF7Q2grg49FdVYr/Il3ttBThPIxvsZy 2WCyfrnp3D1hj/uZ400TksQAL7Y4iDgBdyKAu7CKvGxpRSwT+ls1bpfAe8Hd9UtjQK FpikE1EBImgFw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0F85B68FD2; Sat, 3 Jan 2026 13:07:17 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 3 Jan 2026 13:05:00 -0700 Message-ID: <20260103200510.3605009-30-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103200510.3605009-1-sjg@u-boot.org> References: <20260103200510.3605009-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: QVVFZ74Q6RPGXNA6B6MOYS3VHDJGKQJS X-Message-ID-Hash: QVVFZ74Q6RPGXNA6B6MOYS3VHDJGKQJS X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 29/29] test/py: Add an option to disable the console timeout List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When debugging, particularly when stepping through code in a debugger or dealing with very slow operations, the console timeout can interfere. Add a --no-timeout command-line option that disables the console timeout. Adjust get_default_timeout() to checks for both --gdbserver and --no-timeout, returning None to disable timeouts in either case. This consolidates the timeout-disable logic that was previously spread across multiple locations. Co-developed-by: Claude Signed-off-by: Simon Glass --- (no changes since v1) test/py/console_base.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/test/py/console_base.py b/test/py/console_base.py index c4472420c31..7f044b587b6 100644 --- a/test/py/console_base.py +++ b/test/py/console_base.py @@ -271,6 +271,19 @@ class ConsoleBase(): # call, where the function returns None (assignment-from-none) return spawn.Spawn([]) + def get_default_timeout(self): + """Get the default timeout for commands. + + Subclasses can override this to provide a different timeout. + For example, sandbox may need a longer timeout when mcheck is enabled. + + Returns: + int: Timeout in milliseconds, or None if timeout is disabled + """ + if self.config.gdbserver or self.config.no_timeout: + return None + return TIMEOUT_MS + def eval_patterns(self): """Set up lists of regexes for patterns we don't expect on console""" self.bad_patterns = [pat.pattern for pat in self.avail_patterns @@ -328,7 +341,7 @@ class ConsoleBase(): m = pattern_ready_prompt.search(self.after) self.u_boot_version_string = m.group(2) self.log.info('Lab: Board is ready') - self.timeout = TIMEOUT_MS + self.timeout = self.get_default_timeout() break if m == 2: self.log.info(f'Found autoboot prompt {m}') @@ -616,8 +629,7 @@ class ConsoleBase(): if self.p: # Reset the console timeout value as some tests may change # its default value during the execution - if not self.config.gdbserver: - self.timeout = TIMEOUT_MS + self.timeout = self.get_default_timeout() return try: self.log.start_section('Starting U-Boot') @@ -628,8 +640,7 @@ class ConsoleBase(): # text if LCD is enabled. This value may need tweaking in the # future, possibly per-test to be optimal. This works for 'help' # on board 'seaboard'. - if not self.config.gdbserver: - self.timeout = TIMEOUT_MS + self.timeout = self.get_default_timeout() self.logfile_read = self.logstream if self.config.use_running_system: # Send an empty command to set up the 'expect' logic. This has