From 65186193a57e32bdca0b9f2b7764f4bd9bfb6448 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 20 Oct 2023 13:47:18 +0100 Subject: [PATCH] tests: autofocus_test: Fix intermittent failure due to short timeout Fix an intermittent failure in the focus pause test where the sleep time may not be long enough to account for the pause control to be consumed by the ISP and status returned. Also fix the framerate to 30 for more deterministic results. Signed-off-by: Naushir Patuck --- tests/autofocus_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/autofocus_test.py b/tests/autofocus_test.py index 5f273b59..bc675295 100755 --- a/tests/autofocus_test.py +++ b/tests/autofocus_test.py @@ -18,7 +18,7 @@ print("AF idle") # We should be able to set the lens position and see it reported back. -picam2.set_controls({'LensPosition': 1.5}) +picam2.set_controls({'LensPosition': 1.5, 'FrameRate': 30}) time.sleep(0.5) lp = picam2.capture_metadata()['LensPosition'] if lp < 1.45 or lp > 1.55: @@ -44,7 +44,7 @@ print("Continuous AF state is", state) # Try "pausing" it. picam2.set_controls({'AfPause': controls.AfPauseEnum.Deferred}) - time.sleep(0.2) + time.sleep(0.3) state = picam2.capture_metadata()['AfPauseState'] if state not in (controls.AfPauseStateEnum.Paused, controls.AfPauseStateEnum.Pausing): print("ERROR: continuous AF pause failure, got", state)