From patchwork Wed Apr 24 23:42:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 19950 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 E5793C328D for ; Wed, 24 Apr 2024 23:42:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 54D636340F; Thu, 25 Apr 2024 01:42:47 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="AgWEaM/U"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8DD00633FF for ; Thu, 25 Apr 2024 01:42:35 +0200 (CEST) Received: from pendragon.ideasonboard.com (117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2CC464D0 for ; Thu, 25 Apr 2024 01:41:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1714002103; bh=LzaLktD5tDXg7kuHnEcqENbWwSzTDkSzaRjNbd85sgA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AgWEaM/U/alF6PXeM30X+EUJq0uzp7Oe5n4+N3wlXlip/XCGlRHCR4TInCOdBYhrI y3a8yE/4paTmjkJ7bv1ZsmgsFKXgk3AmYNMifJFA+JhNRgu0/Id6nJZzXKCUwwAsda Hs9LUjilj4wgRKdtF/tjImfjNwfF+AG1PpGxxJUM= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1 5/6] test: v4l2_videodevice: Increase timeout for vimc capture tests Date: Thu, 25 Apr 2024 02:42:23 +0300 Message-ID: <20240424234224.9658-6-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240424234224.9658-1-laurent.pinchart@ideasonboard.com> References: <20240424234224.9658-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 1s 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 --- 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; }