Skip to content

Commit 306f8b7

Browse files
committed
giving time for the device to be discovered after burning fw
1 parent 0ea07d0 commit 306f8b7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

unit-tests/test-fw-update.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,20 @@ def find_image_or_exit( product_name, fw_version_regex = r'(\d+\.){3}(\d+)' ):
242242
time.sleep(3) # MIPI devices do not re-enumerate so we need to give them some time to restart
243243
devices.query( monitor_changes = False )
244244
sn_list = devices.all()
245+
sn_list_size = len(sn_list)
246+
if sn_list_size == 0:
247+
retries = 10
248+
while retries > 0 and sn_list_size == 0:
249+
retries -= 1
250+
time.sleep(3)
251+
devices.query( monitor_changes = False )
252+
sn_list = devices.all()
253+
sn_list_size = len(sn_list)
254+
if sn_list_size == 0:
255+
print("Device discovery... Device not found yet - remaining retries: " + repr(retries) )
256+
else:
257+
print("Device discovery... Device found.")
258+
245259
device = devices.get_first( sn_list ).handle
246260
current_fw_version = rsutils.version( device.get_info( rs.camera_info.firmware_version ))
247261
test.check_equal(current_fw_version, bundled_fw_version if not custom_fw_d400_path else custom_fw_d400_version)

0 commit comments

Comments
 (0)