From patchwork Tue Dec 12 14:16:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alassane Yattara X-Patchwork-Id: 36072 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8E3BC4332F for ; Tue, 12 Dec 2023 14:17:01 +0000 (UTC) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by mx.groups.io with SMTP id smtpd.web11.2563.1702390618498339727 for ; Tue, 12 Dec 2023 06:16:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=yol5VYWT; spf=pass (domain: savoirfairelinux.com, ip: 208.88.110.44, mailfrom: alassane.yattara@savoirfairelinux.com) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 8A9D79C36A9 for ; Tue, 12 Dec 2023 09:16:57 -0500 (EST) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id igyuZ-CEhzI4; Tue, 12 Dec 2023 09:16:57 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 134D59C32E4; Tue, 12 Dec 2023 09:16:57 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 134D59C32E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1702390617; bh=BkeybDozN5OZVIQ0bVa2lGke12WHwRHsSfwhz4Ulb6c=; h=From:To:Date:Message-Id:MIME-Version; b=yol5VYWTdrjQU5ETIGofO5TSP+mx3glbVLMhbYS/T/qkpoVChq/vWshhd//l0cWAu cuVAcz3dJqAPfa0ktmPEwmiZkuLrjS98yvlXxAkI7clbTACHIwtc0+h75gvlnoEIeY KiegLVIUH8j9cRghBVSO8NVpR1HJFGUXYNd9crzkYhp25ZAjK4/5XbwZm4bPDvE/8J NL1Tdz2T1W8meWWYXTu2BRg0J2tbTJ5sMPWtWB485hN2+nfojzYRNdX2fojXiwN31H zvG8ASk0DOOj5duj53kbT9sX/UX1ytwaadfxd9S/gv/ZTbBv7v+Dq2TPh+WpHGpi7c HCHVTySDtOYWQ== X-Virus-Scanned: amavis at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026) with ESMTP id zxglyjDc1Evq; Tue, 12 Dec 2023 09:16:57 -0500 (EST) Received: from jedi.. (unknown [196.127.183.75]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 42E0C9C3598; Tue, 12 Dec 2023 09:16:56 -0500 (EST) From: Alassane Yattara To: toaster@lists.yoctoproject.org Cc: Alassane Yattara Subject: [PATCH 2/4] toaster/test: Handle ProcessLookupError, log warning in console Date: Tue, 12 Dec 2023 15:16:41 +0100 Message-Id: <20231212141643.17627-2-alassane.yattara@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231212141643.17627-1-alassane.yattara@savoirfairelinux.com> References: <20231212141643.17627-1-alassane.yattara@savoirfairelinux.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 12 Dec 2023 14:17:01 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/6082 Note: While addressing warnings on the autobuilder, we encountered relevant warnings where attempts were made to terminate processes that were not running. To enhance visibility, we have opted to catch the ProcessLookupError exception and log a warning in the console rather than suppressing it. Signed-off-by: Alassane Yattara --- lib/toaster/tests/commands/test_runbuilds.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/toaster/tests/commands/test_runbuilds.py b/lib/toaster/tests/commands/test_runbuilds.py index 738d36e9..849c227e 100644 --- a/lib/toaster/tests/commands/test_runbuilds.py +++ b/lib/toaster/tests/commands/test_runbuilds.py @@ -22,8 +22,6 @@ import signal import logging -logger = logging.getLogger("toaster") - class KillRunbuilds(threading.Thread): """ Kill the runbuilds process after an amount of time """ def __init__(self, *args, **kwargs): @@ -43,7 +41,7 @@ class KillRunbuilds(threading.Thread): pid = pidfile.read() os.kill(int(pid), signal.SIGTERM) except ProcessLookupError: - logger.warning("Runbuilds not running or already killed") + logging.warning("Runbuilds not running or already killed") class TestCommands(TestCase):