diff --git a/unit-tests/live/options/test-rgb-options-metadata-consistency.py b/unit-tests/live/options/test-rgb-options-metadata-consistency.py index 211b0568220..dc624b737b2 100644 --- a/unit-tests/live/options/test-rgb-options-metadata-consistency.py +++ b/unit-tests/live/options/test-rgb-options-metadata-consistency.py @@ -4,7 +4,7 @@ #test:device each(D400*) import pyrealsense2 as rs -from rspy import test +from rspy import test, log def close_resources(sensor): if len(sensor.get_active_streams()) > 0: @@ -64,11 +64,12 @@ def check_option_and_metadata_values(option, metadata, value_to_set, frame): option_index = -1 # running over options value_index = -1 # 0, 1, 2 for min, max, default # number of frames to wait between set_option and checking metadata - # is set as 10 - the expected delay is ~120ms for Win and ~80-90ms for Linux + # is set as 15 - the expected delay is ~120ms for Win and ~80-90ms for Linux num_of_frames_to_wait = 15 while True: try: lrs_frame = lrs_queue.wait_for_frame(5000) + log.d("iteration:", iteration) if iteration == 0: option_index = option_index + 1 if option_index == len(color_options): @@ -87,9 +88,11 @@ def check_option_and_metadata_values(option, metadata, value_to_set, frame): value_to_set = option_range.max elif iteration == 2 * (num_of_frames_to_wait + 1): value_to_set = option_range.default - if iteration % (num_of_frames_to_wait + 1) == 0: # for iterations 0, 11, 22 + if iteration % (num_of_frames_to_wait + 1) == 0: # for iterations 0, 16, 32 + log.d("setting option:", option, "to", value_to_set) color_sensor.set_option(option, value_to_set) - if (iteration + 1) % (num_of_frames_to_wait + 1) == 0: # for iterations 10, 21, 32 + if (iteration + 1) % (num_of_frames_to_wait + 1) == 0: # for iterations 15, 31, 47 + log.d("checking MD:", metadata, "vs option:", option) check_option_and_metadata_values(option, metadata, value_to_set, lrs_frame) iteration = (iteration + 1) % (3 * (num_of_frames_to_wait + 1))