Skip to content

Commit 9442919

Browse files
committed
Added a stopper for the function test_ownership_receivers
1 parent ceaca13 commit 9442919

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test_suite_functions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def test_ownership_receivers(child_sub, samples_sent, last_sample_saved, timeout
4848
list_data_received_second = []
4949
list_data_received_first = []
5050
max_samples_received = MAX_SAMPLES_READ
51+
max_retries = 500
52+
current_retries = 0
5153
samples_read = 0
5254
list_samples_processed = []
5355
last_first_sample = ''
@@ -113,8 +115,14 @@ def test_ownership_receivers(child_sub, samples_sent, last_sample_saved, timeout
113115
print(f'Last samples: {last_first_sample}, {last_second_sample}')
114116
# Otherwise, wait a bit and continue
115117
time.sleep(0.1)
118+
current_retries += 1
119+
if current_retries > max_retries:
120+
print('Max retries exceeded')
121+
return ReturnCode.DATA_NOT_CORRECT
116122
continue
117123

124+
current_retries = 0
125+
118126
# Keep all samples processed in a single list, so we can check whether
119127
# the last sample published by any publisher has already been processed
120128
list_samples_processed.append(sub_string.group(0))

0 commit comments

Comments
 (0)