From patchwork Tue Jan 6 14:28:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1302 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=1767709819; bh=FpvBufLCGvzCSmbtWfyfrpGA/+7IuMr15uBRUNs+v3Y=; 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=dj3QXNMj4WAQYD6rn5CqCXi14GW10X1Ra2ct7pfXwaxBn3x1h3JobrxwJ8F0TC9KN X/FgTEUEVuhYDa5lnkozwt7MBD9rNTo7Ek6DfxVumVObuskJRrY6xj+wwlhAfW10nV fGT5fbvL2DAdkm1114PIDKRPB0EZ7FbeqaKiPpSR6PnS3nLhN6ojAOFPuVJYxrOwyP HFl/5SuodfmijCD/dK0kBARVcAKfGmmK0/0/QF2E/yXvywQDkOd3mXTlegETwAFugA /G6RfKWOEWAr+wf1hRyckItrFd+ZTNPkX2Wv1LA4UOY88vc4C0NlqiiJRSapwyw3lD 4E3rskAwDS8FA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8B48969142 for ; Tue, 6 Jan 2026 07:30:19 -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 R3wDzls2XJSz for ; Tue, 6 Jan 2026 07:30:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767709819; bh=FpvBufLCGvzCSmbtWfyfrpGA/+7IuMr15uBRUNs+v3Y=; 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=dj3QXNMj4WAQYD6rn5CqCXi14GW10X1Ra2ct7pfXwaxBn3x1h3JobrxwJ8F0TC9KN X/FgTEUEVuhYDa5lnkozwt7MBD9rNTo7Ek6DfxVumVObuskJRrY6xj+wwlhAfW10nV fGT5fbvL2DAdkm1114PIDKRPB0EZ7FbeqaKiPpSR6PnS3nLhN6ojAOFPuVJYxrOwyP HFl/5SuodfmijCD/dK0kBARVcAKfGmmK0/0/QF2E/yXvywQDkOd3mXTlegETwAFugA /G6RfKWOEWAr+wf1hRyckItrFd+ZTNPkX2Wv1LA4UOY88vc4C0NlqiiJRSapwyw3lD 4E3rskAwDS8FA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 755C769118 for ; Tue, 6 Jan 2026 07:30:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767709817; bh=fboVpwy9EWt/hGF3bNAtPNjRbY9zpe58qifmJYq5rLA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vuGCujibgnKeQWu1G5eIPtoc3QctaxsGmzMhJWSH8u74C76SzX/7PV7DM74B8wGiq IgEa+D2cGaJ121vDu1Pp+4klfL9/FGqNkM+PJEmot0wl4pgezBwNd3SR4sun1ww7N1 C9TVtmsZSI5VdrVK8lXcahbEOORdoZXwv8NaH4tm5EEIimRKqX8nuPefA+7Y8Fx+Ok YkrHaQmy26TIy+ILnf8ksiIzdrnnKOOn5WMrBvfOy8yxB2s/xNH6sgTzoFdaKt7hpI wy9v5t+Ep2tDfrL8VwH92WPhME8bdf9HMng9Y9onR8NjXfW+QOxXunHWY7KTiPJzS2 dHjEzTJbpOQTw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3D6FF69087; Tue, 6 Jan 2026 07:30:17 -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 fgIP3miqrc1T; Tue, 6 Jan 2026 07:30:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767709812; bh=cfOvzxUFIQSUjwR4AousL0mYnZfg0EsQCgJILTiH2fI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=krCXjDGS1DGFi/IPUcRW+xVYPsxGkdhaIvSWBfWVCtgHD0ekGj+bipjYTPAyYjy6m LyrU6yU0x33k2w2aFrgMa1foxxHAfVYMeTgpofcwSI2Hm/3RzaduhTOGmD8ZsDWnsX r375Se/QDw96ROUbFDmlpLse9yE6RZQjFy+3choHNWYUHZINqQdC2hWSoq0sfLEA+W FFQKiC/MmDecnQC5qVey+LpNV6dw08IWXmKHCPWmSTcUNOldlizJJ3jRi8cgGSpn8S uYborowqkg5DbpATsPbf4G/1FlqvjtEugf+3wXgTplBiYEZCvnDVI1OGpIi0OQfcx9 JHf6CcFOGQHKQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7266169054; Tue, 6 Jan 2026 07:30:12 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 6 Jan 2026 07:28:26 -0700 Message-ID: <20260106142834.2511220-22-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260106142834.2511220-1-sjg@u-boot.org> References: <20260106142834.2511220-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VPHVCYBXOQWMLJQDHYDO74QDP2FQJKGB X-Message-ID-Hash: VPHVCYBXOQWMLJQDHYDO74QDP2FQJKGB 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: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 21/22] buildman: Split test_process_limit() into two tests in test.py 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 Split the test into test_process_limit() for basic operation, timeout and lock-busting, and test_process_limit_dead() for dead process handling. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/test.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/buildman/test.py b/tools/buildman/test.py index eafe2acb122..f37f868da60 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -986,6 +986,26 @@ class TestBuildMisc(TestBuildBase): self.assertEqual(control.RUN_WAIT_S, self.cur_time) lock.release() + def test_process_limit_dead(self): + """Test wait_for_process_limit() with dead processes""" + tmpdir = self.base_dir + + with (patch('time.time', side_effect=self.get_time), + patch('time.perf_counter', side_effect=self.get_time), + patch('time.monotonic', side_effect=self.get_time), + patch('time.sleep', side_effect=self.inc_time), + patch('os.kill', side_effect=self.kill)): + # Set up initial state with PIDs 1, 2, 3 in file + control.wait_for_process_limit(1, tmpdir=tmpdir, pid=1) + self.valid_pids = [1] + control.wait_for_process_limit(1, tmpdir=tmpdir, pid=2) + self.valid_pids = [1, 2] + lock_fname = os.path.join(tmpdir, control.LOCK_FNAME) + lock = FileLock(lock_fname) + lock.acquire(timeout=1) + control.wait_for_process_limit(1, tmpdir=tmpdir, pid=3) + lock.release() + # Check handling of dead processes. Here we have PID 2 as a running # process, even though the PID file contains 1, 2 and 3. So we can # add one more PID, to make 2 and 4