From patchwork Sat Jan 3 01:19: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: 1218 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=1767403246; bh=R7cH29x0VeuSvWdBPkVOQhhalr9e/k8qLvbm5g5S2Us=; 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=TieX5cW5S/wmDbMz2/YMud2CX8FSCstvAwHK+8uq9xylm9DSID2RG1KgKyY/bfYPR WaxPbdg2APa6UU5R2vkWl3ja9wQ8FpzbB02a2IdtmODI5wmaqCuqMen94NGxxHxjgm 5wQ2y2RPNv86IryxKaZ0HEfqFVw8+jFAxy24iL5XZgCzyP+b+q0mT0feanzqTy0EU5 mIuuRA2TM6rkeW+SYGvfEFPwnCiRRAvp6I5xehpKJQ8dgmGgRy2bOeu1Gk9a/5+XWQ wHzIDBBPD7AI12yvSVEeR72KSXtthmhAEu3IX0YlAHlH1/ni2TlVZ+DerRb1nlbm3w aodGAsBK3TdKA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E0D886905F for ; Fri, 2 Jan 2026 18:20:46 -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 R8rXY2RfXmh3 for ; Fri, 2 Jan 2026 18:20:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767403246; bh=R7cH29x0VeuSvWdBPkVOQhhalr9e/k8qLvbm5g5S2Us=; 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=TieX5cW5S/wmDbMz2/YMud2CX8FSCstvAwHK+8uq9xylm9DSID2RG1KgKyY/bfYPR WaxPbdg2APa6UU5R2vkWl3ja9wQ8FpzbB02a2IdtmODI5wmaqCuqMen94NGxxHxjgm 5wQ2y2RPNv86IryxKaZ0HEfqFVw8+jFAxy24iL5XZgCzyP+b+q0mT0feanzqTy0EU5 mIuuRA2TM6rkeW+SYGvfEFPwnCiRRAvp6I5xehpKJQ8dgmGgRy2bOeu1Gk9a/5+XWQ wHzIDBBPD7AI12yvSVEeR72KSXtthmhAEu3IX0YlAHlH1/ni2TlVZ+DerRb1nlbm3w aodGAsBK3TdKA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C7BE668BF2 for ; Fri, 2 Jan 2026 18:20:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767403243; bh=Dm3rx2dnGUoGIgedll6uGHqM9zbyRRKBSkK0ZU2WDF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XSdVBpY7AuswHaDy2N5dp+R3c+WRY1mArE57pPpUkgOXW26FYYFBqzH38ZvgmUsAE W230Vc8rDaZTOt/HEn0RxX2PxRlVOe0l5DRZGJMeZSVbXLBm3PgbztpBkm/IJh2qY5 SoB2gL+G+URQb9GekpnDwx5Zr5U+nhp6T5bnKCEdYzZv9sqCmvDD/DLWqz10OFNaol wNtTMKudP70gQK+rJIJ7p/YYMHH/h2FRdVkZqQgIDXRe5kTEBAwayWK5xXY5RvTWz0 2U4XijuTYPdq9a2MWXXojMPULMN551riu75+qJTXFfGF2Ac3hhzk7hEPIz4N6JLd0o /AXLWfW6MWBVQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ACD4368F87; Fri, 2 Jan 2026 18:20:43 -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 tPzOBEBlxHpm; Fri, 2 Jan 2026 18:20:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767403242; bh=dYNtS/7iEskQ06DNzviNLEFPYybV9F7eMvHdVEf4kck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=INYsyg4jsF8CsbUhKuLK1nzCTNwBheTdaGfe3GJrducfggGlfwjr7Ve3eB8UE1YF9 EUd82QrrOkhIHqKr2snUjtU8CsCfhUDvS5EXTht9l3E8Xej53135tVULIipsV6WJjX HG6w9HK0+y1FveBUZvFv0ER/GXk+zYb+024ot7z2kWPj9KmrhxRvDDdpZFa1SUDM/l va5v3p4XTbnrQ4EP75MnI+ba5uBdy6w58YjBRv5yAk60of9NdpFr579NuLFhOQy0Sn zG/oxaXgyQ8NJIMTYp5ACerfi9GO6OyKdF53viTgrRRD9l1E3ui6NaDU2m+oaGQDLW DFKhZ2p9Cm4VA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 65E1068BF2; Fri, 2 Jan 2026 18:20:42 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 2 Jan 2026 18:19:00 -0700 Message-ID: <20260103011908.149445-25-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260103011908.149445-1-sjg@u-boot.org> References: <20260103011908.149445-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: KEMTZBHV2YVPC3XNUR2CTCSIBSMR4EZP X-Message-ID-Hash: KEMTZBHV2YVPC3XNUR2CTCSIBSMR4EZP 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 24/24] 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 --- 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