Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp19708lqc; Thu, 29 Feb 2024 09:11:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUMhP2EOtQDAwqqU3UBCdWhExZi28S75fLTchbEBKN8iCr+Ril7MsAS8ZkGS0FjjxI/5x1FKg1zR1VghBvqmSjrZz8ZVtTKy1IwFBSBDA== X-Google-Smtp-Source: AGHT+IFm8+A86k/Jd6u+pKTilQ7NbhdwEWhREfB0HY+Ty4O2dImwh+FEMq5DsuSHO2vUfCa3eoGC X-Received: by 2002:a05:620a:199e:b0:787:bab4:9023 with SMTP id bm30-20020a05620a199e00b00787bab49023mr3357057qkb.1.1709226665746; Thu, 29 Feb 2024 09:11:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709226665; cv=pass; d=google.com; s=arc-20160816; b=ocv14pKE2U46G8K0/GaGcuyVyF+LtBXvXz82mT7grmq377dYZ7xUnOcJtmxbDjBD/3 Z8pNHAxotr+0DSJ/j4qrIqxibGXzfXSJICcmYyTYr2up8Spw+p/HTpYy+hZPn7UU1bmK +UEInbdRl4+yt4php7Hxn2022c39hjQ2TmtZrHdpjrSsuK311+rNm2Nf7CEcUUn1Fzlg EH4KkqgbVUnn7Mtt6/WNBMoJnaU74zhzJrfj8AFX2csSGBFqvTV9ofiRfveN1GnsKVnh YOsWemKswliF0k0dx9Y6WJUEAomiUhZzF7XpuDc/mxSkU7qFN2ILzNHF5w2fI5qNSMNL W4vg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=F+N3EblraYxJ9PnDdPFn0W4Elk/OpZY13p56z9FVKpE=; fh=MR/wbEn34JHmT+rtzWNq5RVU/RKi8DhjSvb3ywiuLkE=; b=bcfrIrH2wgKd2KLl1k/BD/a8cabW1VxYfQ3nZ11x60P+ByYbm+eMCIVmd4q9ZYIMLe 1tnA0dkgElNbtN67y+u9+POVIBBE8KaQb2Qv7r38fozBsiU2iJLhoyJQ9+BBuGwatF0+ lnqoEcf72zKYl8ogHn9qJxavh45BWYBu0mhkR6nCvnaQymWyahZ4ixPoP0Lo0dUD9LOK eWCpKMbP4iWL8fB5hmL06F5jYgKlZNiVbV9FcRd0sxRynNqZwz9EZtsEnBdEjGWRKnDh P+uvdZtlACyLUPyTkoEbcdoO4/zxGDlsZaJxMvXtW/iUNp2iD8kDI5nD793mtaC+FOkY vwoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b="g3VQrtX/"; arc=pass (i=1 spf=pass spfdomain=digikod.net dkim=pass dkdomain=digikod.net); spf=pass (google.com: domain of linux-kernel+bounces-87146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87146-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id n5-20020a05620a222500b00787fa00d573si1649466qkh.637.2024.02.29.09.11.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 09:11:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b="g3VQrtX/"; arc=pass (i=1 spf=pass spfdomain=digikod.net dkim=pass dkdomain=digikod.net); spf=pass (google.com: domain of linux-kernel+bounces-87146-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87146-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4F93B1C225F2 for ; Thu, 29 Feb 2024 17:10:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF6876CBE3; Thu, 29 Feb 2024 17:10:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b="g3VQrtX/" Received: from smtp-8fae.mail.infomaniak.ch (smtp-8fae.mail.infomaniak.ch [83.166.143.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95D6D160639 for ; Thu, 29 Feb 2024 17:10:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.166.143.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709226611; cv=none; b=CdwCCj+ks5U/FLO+H9P0qBWvf8vAY7TANt3RYTEuFKjc0Y+TLbcoNO1uLh/4xVk8Y0C13xwRvtUEjq/OOD37ZJKVTBIjS2vPuJf1GT9hfLySZeXJcfE553ba/Pj1c8CHDFeOdlpE52DRxNjt119xdq1DPIyfBG+a92zQbDavPJY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709226611; c=relaxed/simple; bh=uBMChHU5UNMlEl3ATgwx20Pp9VOumM9CW4wvZ2gv728=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gLwKLjNGjeXOPfYW+woKkM1MyFZYwrJpI3vNI92yUtinW7nxqF5BNWidkTwCP3Rs84kr4kcRzhG5smnw3ckcqOwNp53ITcmXhahGQK5TiBED/CaLvuaizSH1qZokfE+svaFfBiWnGYYHKY/iuFYfV701RZ/wWC0HG3HJdvkCzYE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net; spf=pass smtp.mailfrom=digikod.net; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b=g3VQrtX/; arc=none smtp.client-ip=83.166.143.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=digikod.net Received: from smtp-3-0001.mail.infomaniak.ch (unknown [10.4.36.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4TlyHv6JJjzMrkvR; Thu, 29 Feb 2024 18:04:27 +0100 (CET) Received: from unknown by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4TlyHv0Y1GzMppV9; Thu, 29 Feb 2024 18:04:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1709226267; bh=uBMChHU5UNMlEl3ATgwx20Pp9VOumM9CW4wvZ2gv728=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g3VQrtX/j4mrYOK5lCD4XPwom/SI0/y/0R4myV2rOLoAWJbQXs3vRNiqY7hBGvPKt IWhFH8Ae2AB6sbRZrZYR+D0SJT6lcgzTL2uwOpY7ATOhYsFr6lnwl26n6gEktkAfAl F696GqV8G1WnaDB4mg5K41u90uy9ksSd19IE4k0Q= From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= To: Brendan Higgins , David Gow , Kees Cook , Rae Moar , Shuah Khan Cc: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , Alan Maguire , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Ingo Molnar , James Morris , Luis Chamberlain , "Madhavan T . Venkataraman" , Marco Pagani , Paolo Bonzini , Sean Christopherson , Stephen Boyd , Thara Gopinath , Thomas Gleixner , Vitaly Kuznetsov , Wanpeng Li , Zahra Tarkhani , kvm@vger.kernel.org, linux-hardening@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-um@lists.infradead.org, x86@kernel.org Subject: [PATCH v1 4/8] kunit: Fix timeout message Date: Thu, 29 Feb 2024 18:04:05 +0100 Message-ID: <20240229170409.365386-5-mic@digikod.net> In-Reply-To: <20240229170409.365386-1-mic@digikod.net> References: <20240229170409.365386-1-mic@digikod.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha The exit code is always checked, so let's properly handle the -ETIMEDOUT error code. Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Cc: Shuah Khan Signed-off-by: Mickaël Salaün --- lib/kunit/try-catch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/kunit/try-catch.c b/lib/kunit/try-catch.c index 73f5007f20ea..cab8b24b5d5a 100644 --- a/lib/kunit/try-catch.c +++ b/lib/kunit/try-catch.c @@ -79,7 +79,6 @@ void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context) time_remaining = wait_for_completion_timeout(&try_completion, kunit_test_timeout()); if (time_remaining == 0) { - kunit_err(test, "try timed out\n"); try_catch->try_result = -ETIMEDOUT; kthread_stop(task_struct); } @@ -94,6 +93,8 @@ void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context) try_catch->try_result = 0; else if (exit_code == -EINTR) kunit_err(test, "wake_up_process() was never called\n"); + else if (exit_code == -ETIMEDOUT) + kunit_err(test, "try timed out\n"); else if (exit_code) kunit_err(test, "Unknown error: %d\n", exit_code); -- 2.44.0