From patchwork Wed May 29 15:43:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20123 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 509A9BDE6B for ; Wed, 29 May 2024 15:44:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BF115634C6; Wed, 29 May 2024 17:44:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="i+z4xdIC"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C0750634BA for ; Wed, 29 May 2024 17:43:59 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2569E149B for ; Wed, 29 May 2024 17:43:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1716997436; bh=bUPY7XPjTlm9uXOp8blQK9548NSEm5tq5BNvcpWljHQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=i+z4xdIC/wO2ZJJOfkK8G5XsctvbGgeUD9tCMGLhIov8ZN/LEHTb/1b7JuwaJ/BX+ qBbFsTkvbXcgD34Ma9BcxCDIzkH+8wD4AOlwgCAGV7spXybIT7jpMHbbop0P9rvt57 VsZWSSHJXaQVvR7xQRP2fZXo9UhHDS4XdgKf03s8= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 5/6] test: v4l2_videodevice: Increase timeout for vimc capture tests Date: Wed, 29 May 2024 18:43:40 +0300 Message-ID: <20240529154341.10426-6-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.1 In-Reply-To: <20240529154341.10426-1-laurent.pinchart@ideasonboard.com> References: <20240529154341.10426-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" On slower machines, a 10s timeout to capture frames with vimc can be too short and cause test failures. Make the timeout proportional to the number of frames expected to be captured, using a conservative low estimate of the frame rate at 2fps. This does not increase the test time if the vimc driver is fast enough to produce frames. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- Changes since v1: - Fix the timeout duration mentioned in the commit message --- test/v4l2_videodevice/capture_async.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/v4l2_videodevice/capture_async.cpp b/test/v4l2_videodevice/capture_async.cpp index 42e1e671790b..673664615ada 100644 --- a/test/v4l2_videodevice/capture_async.cpp +++ b/test/v4l2_videodevice/capture_async.cpp @@ -61,10 +61,12 @@ protected: if (ret) return TestFail; - timeout.start(10000ms); + const unsigned int nFrames = 30; + + timeout.start(500ms * nFrames); while (timeout.isRunning()) { dispatcher->processEvents(); - if (frames > 30) + if (frames > nFrames) break; } @@ -73,8 +75,9 @@ protected: return TestFail; } - if (frames < 30) { - std::cout << "Failed to capture 30 frames within timeout." << std::endl; + if (frames < nFrames) { + std::cout << "Failed to capture " << nFrames + << " frames within timeout." << std::endl; return TestFail; }