Skip to content

Commit

Permalink
Refs #21219: Fix flakyness on test with participants in the same cont…
Browse files Browse the repository at this point in the history
…ainer

Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
  • Loading branch information
JesusPoderoso committed Jul 1, 2024
1 parent d3ca40c commit a6d6bf0
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 24 deletions.
5 changes: 1 addition & 4 deletions test/examples/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,9 @@ def test_configuration(pub_args, sub_args):
for line in render_out:
if 'SENT' in line:
sent += 1
continue

if 'RECEIVED' in line:
received += 1
continue

if sent != 0 and received != 0 and sent * 2 == received:
ret = True
Expand Down Expand Up @@ -158,8 +156,7 @@ def test_configuration_expected_output(pub_args, sub_args, expected_message, n_m
for line in render_out:
if expected_message in line:
count += 1
continue


if count >= int(n_messages):
ret = True
else:
Expand Down
4 changes: 1 addition & 3 deletions test/examples/test_content_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,14 @@ def test_content_filter(pub_reader_filters, sub_custom_filter):
for line in out:
if 'SENT' in line:
sent += 1
continue

if 'RECEIVED' in line:
received += 1
match = re.search(r'index:\s+(\d+)', line)
if match:
number = int(match.group(1))
data.append(number)
continue


ret = True
if sent != 0 and received != 0:
for elem in data:
Expand Down
4 changes: 1 addition & 3 deletions test/examples/test_custom_payload_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ def test_custom_payload_pool():
for line in out:
if 'SENT' in line:
sent += 1
continue

if 'RECEIVED' in line:
received += 1
continue


if sent != 0 and received != 0 and sent == received:
ret = True
else:
Expand Down
6 changes: 2 additions & 4 deletions test/examples/test_delivery_mechanisms.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ def test_delivery_mechanisms(pub_args, sub_args, isub_args, pubsub_args, repetit
for line in out:
if 'SENT' in line:
sent += 1
continue

if 'RECEIVED' in line:
received += 1
continue

if sent != 0 and received != 0 and repetitions == received:
ret = True
else:
Expand Down Expand Up @@ -142,8 +141,7 @@ def test_delivery_mechanisms_expected_output(pub_args, sub_args, pubsub_args, ex
for line in render_out:
if expected_message in line:
count += 1
continue


if count >= int(n_messages):
ret = True
else:
Expand Down
6 changes: 2 additions & 4 deletions test/examples/test_delivery_mechanisms_isolated.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ def test_delivery_mechanisms_isolated(pub_args, sub_args, isub_args, pubsub_args
for line in out:
if 'SENT' in line:
sent += 1
continue

if 'RECEIVED' in line:
received += 1
continue

if sent != 0 and received != 0 and repetitions == received:
ret = True
else:
Expand Down Expand Up @@ -129,8 +128,7 @@ def test_delivery_mechanisms_isolated_expected_output(pub_args, sub_args, pubsub
for line in render_out:
if expected_message in line:
count += 1
continue


if count >= int(n_messages):
ret = True
else:
Expand Down
4 changes: 1 addition & 3 deletions test/examples/test_hello_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ def test_hello_world():
for line in out:
if 'SENT' in line:
sent += 1
continue

if 'RECEIVED' in line:
received += 1
continue


if sent != 0 and received != 0 and sent * 2 == received:
ret = True
else:
Expand Down
4 changes: 1 addition & 3 deletions test/examples/test_xtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ def test_xtypes():
for line in out:
if 'sent' in line or 'SENT' in line:
sent += 1
continue

if 'received' in line or 'RECEIVED' in line:
received += 1
continue


if sent != 0 and received != 0 and sent * 3 == received:
ret = True
else:
Expand Down

0 comments on commit a6d6bf0

Please sign in to comment.