Skip to content

Commit

Permalink
tests: autofocus_test: Fix intermittent failure due to short timeout
Browse files Browse the repository at this point in the history
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 <naush@raspberrypi.com>
  • Loading branch information
naushir committed Oct 20, 2023
1 parent 39366e5 commit 6518619
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/autofocus_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit 6518619

Please sign in to comment.