From patchwork Wed Apr 24 23:42:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 19949 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 C771DC3200 for ; Wed, 24 Apr 2024 23:42:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 629136340C; Thu, 25 Apr 2024 01:42:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="iYvFSwo+"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3E29E633F2 for ; Thu, 25 Apr 2024 01:42:34 +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 5E4F4B1 for ; Thu, 25 Apr 2024 01:41:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1714002102; bh=tGpmxDogLQh4fFVS0jnV03J4D0q89NHJjSUHqBWaGfw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iYvFSwo+tw+2ABgpf5DrftCVYucOMvaYnMUOQY5jwAowRzlU3ihl6+wobPSwoZ4NJ tmQ6V5oEg+7kxgkb5QecGm3/m+rT37FoCP/aWnY4xkULgkbW5KiSo8rK8VJzQOAf9r MslfJ31dbx/gkrCWcL3QvkERe3cKNOnuh/8m9zkU= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1 4/6] test: fence: Increase timeout for fence test Date: Thu, 25 Apr 2024 02:42:22 +0300 Message-ID: <20240424234224.9658-5-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. By itself, that change could increase the test time quite substantially on fast platforms, so break from the capture loop as soon as we capture enough frames. Signed-off-by: Laurent Pinchart --- test/fence.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/fence.cpp b/test/fence.cpp index 7949bfbb176b..4ce6dfa23590 100644 --- a/test/fence.cpp +++ b/test/fence.cpp @@ -315,8 +315,9 @@ int FenceTest::run() /* Loop for one second. */ Timer timer; - timer.start(1000ms); - while (timer.isRunning() && expectedCompletionResult_) { + timer.start(500ms * (signalledRequestId_ + 1)); + while (timer.isRunning() && expectedCompletionResult_ && + completedRequestId_ <= signalledRequestId_ + 1) { if (completedRequestId_ == signalledRequestId_ - 1 && setFence_) /* * signalledRequestId_ has just completed and it has