Skip to content

Commit

Permalink
All topics testing2
Browse files Browse the repository at this point in the history
  • Loading branch information
PrasRsRos committed Sep 11, 2023
1 parent 5f7ec20 commit 426776b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions realsense2_camera/test/utils/pytest_rs_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ def spin_for_data(self,themes, timeout=5.0):
flag = False
data_not_expected = [i for i in themes if (i["expected_data_chunks"]) == 0]
start = time.time()
msg = "Unexpected error in spin_for_data"
msg = ""
while (time.time() - start) < timeout:
rclpy.spin_once(self.node, timeout_sec=1)
debug_print('Spun once... ' )
Expand All @@ -848,9 +848,11 @@ def spin_for_data(self,themes, timeout=5.0):
if data_not_expected == False:
print("Timed out waiting for", timeout, "seconds" )
return False, "run_test timedout"
flag = True
if flag:
return flag,""
if flag ==False:
for theme in themes:
if theme['expected_data_chunks'] > int(self.node.get_num_chunks(theme['topic'])):
msg = "Data expected, but not received for: " + theme['topic']
break
return flag,msg

def spin_for_time(self,wait_time):
Expand Down

0 comments on commit 426776b

Please sign in to comment.