From patchwork Fri Nov 10 15:30:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 34265 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 4AD4FC4332F for ; Fri, 10 Nov 2023 15:30:56 +0000 (UTC) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mx.groups.io with SMTP id smtpd.web10.30147.1699630254016248566 for ; Fri, 10 Nov 2023 07:30:54 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OxoMd/D1; spf=pass (domain: gmail.com, ip: 209.85.210.182, mailfrom: ticotimo@gmail.com) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6c396ef9a3dso2036279b3a.1 for ; Fri, 10 Nov 2023 07:30:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699630253; x=1700235053; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=RpNvhC24gFg8pXGSLeBE0miX8I/P9d1eNObp6oNsEX0=; b=OxoMd/D1SYlV4aj17wYoXAoFp9KrJOSHvGom/8ynJX/TKvV01Zn5E4HatsvjjoOuDK yf82vtNmby9fb1weaetBKYnqZvYE/ug0n4J6hDWeziCjC3NQBJLPhnmz41ohB3GuXuCV y5v7Kw6i9RZ2EwzruylRaMwPOjhN3oIBKKB08inYv/ZidgSnZffDrKqaUpG9OhcBhwqI 9GBCl5RGOBpjgVe0mTwvVhx8wuF6jtZuikTGcrUBubDK27YSYS6UsyHDfZgdroEqaCkn irswUwN40mJVKv3UqHRm2Uqbz4+bVfxoLJo19AupyEYTBC/6W7Eng19BPRcr2BekwsFg ssRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699630253; x=1700235053; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RpNvhC24gFg8pXGSLeBE0miX8I/P9d1eNObp6oNsEX0=; b=qL1a+l+GtT50D789mWkNDqCWSk/7/2dFWWS5nTaRwjSvlDcOSdY0Thp/Q1Tl1Ojr0E 2LkZ8paqU5fyVqGvNCjBp02oJ/LL9/s/HNCvDi95CsRyH0/w2vEBUfYbTUE6oouRyvqg U222wv12PZW15vrHJPwbczxm04MIofjOTRd2Yvbqs16A1VYjBUAAiM4qmDvZ5Fb34LLm mhxqlggGFNo78yblCeatbU444YjsENMP+PEGh7RhkNGFoWax4AmqvvisWNDvv9KE8FVq H4lKpiSfhpHveOsFSkhxoM/VSDKbo45MOO/lj3IHUYlD0cl7uf/jIXubtcwcErSk/5UL +lvQ== X-Gm-Message-State: AOJu0YyeJzhjmVYfPtFiP++vmq2dBIp9HHKTi9hrXce2AmCWkag1uS+7 /2TGY3luIV3fyU76W8dKgC0= X-Google-Smtp-Source: AGHT+IGZBR6Ps76+quR1Mq/Cf5xkdoHyqr5NdYiYGBrEXuAxy5y5x5/4UoGhXCSsbxDJQpWsACiJjA== X-Received: by 2002:a05:6a00:1a91:b0:693:3c11:4293 with SMTP id e17-20020a056a001a9100b006933c114293mr7972664pfv.14.1699630253399; Fri, 10 Nov 2023 07:30:53 -0800 (PST) Received: from chiron.hsd1.or.comcast.net ([2601:1c0:ca00:cea0:cf02:179f:ed0:bddf]) by smtp.gmail.com with ESMTPSA id l21-20020a635b55000000b0058c1383fa8bsm6693706pgm.0.2023.11.10.07.30.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 07:30:53 -0800 (PST) From: Tim Orling X-Google-Original-From: Tim Orling To: bitbake-devel@lists.openembedded.org, toaster@lists.yoctoproject.org Cc: Tim Orling Subject: [PATCH] toaster: log ProcessLookupError in test_runbuilds Date: Fri, 10 Nov 2023 07:30:10 -0800 Message-Id: <20231110153009.3592572-1-tim.orling@konsulko.com> X-Mailer: git-send-email 2.34.1 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 ; Fri, 10 Nov 2023 15:30:56 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/5986 This repeatably fails: Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File ".../poky/bitbake/lib/toaster/tests/commands/test_runbuilds.py", line 39, in run os.kill(int(pid), signal.SIGTERM) ProcessLookupError: [Errno 3] No such process Rather than have a hard error, add logging and output as a warning. Signed-off-by: Tim Orling --- lib/toaster/tests/commands/test_runbuilds.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/toaster/tests/commands/test_runbuilds.py b/lib/toaster/tests/commands/test_runbuilds.py index c77d6cf4..14b35764 100644 --- a/lib/toaster/tests/commands/test_runbuilds.py +++ b/lib/toaster/tests/commands/test_runbuilds.py @@ -19,6 +19,10 @@ import time import subprocess import signal +import logging + +logger = logging.getLogger("toaster") + class KillRunbuilds(threading.Thread): """ Kill the runbuilds process after an amount of time """ @@ -36,8 +40,11 @@ class KillRunbuilds(threading.Thread): with open(pidfile_path) as pidfile: pid = pidfile.read() - os.kill(int(pid), signal.SIGTERM) - + try: + os.kill(int(pid), signal.SIGTERM) + except ProcessLookupError as err: + logger.warning("Failed to kill pid. %s" % err) + pass class TestCommands(TestCase): """ Sanity test that runbuilds executes OK """