Skip to content

Commit

Permalink
Tried fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianReimold committed Nov 20, 2024
1 parent e571c47 commit 929cc4a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/tcp_pubsub_test/src/tcp_pubsub_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ TEST(tcp_pubsub, basic_test)
// Wait up to 1 second for the subscriber to connect
for (int i = 0; i < 10; ++i)
{
if (hello_world_subscriber.getSessions().at(0)->isConnected())
if (hello_world_subscriber.getSessions().at(0)->isConnected()
&& hello_world_publisher.getSubscriberCount() >= 1)
{
break;
}
Expand Down Expand Up @@ -123,7 +124,8 @@ TEST(tcp_pubsub, large_message_test)
// Wait up to 1 second for the subscriber to connect
for (int i = 0; i < 10; ++i)
{
if (hello_world_subscriber.getSessions().at(0)->isConnected())
if (hello_world_subscriber.getSessions().at(0)->isConnected()
&& hello_world_publisher.getSubscriberCount() >= 1)
{
break;
}
Expand Down Expand Up @@ -190,7 +192,10 @@ TEST(tcp_pubsub, multiple_publishers_test)
// Wait up to 1 second for the subscriber to connect
for (int i = 0; i < 10; ++i)
{
if (hello_world_subscriber.getSessions().at(0)->isConnected() && hello_world_subscriber.getSessions().at(1)->isConnected())
if (hello_world_subscriber.getSessions().at(0)->isConnected()
&& hello_world_subscriber.getSessions().at(1)->isConnected()
&& hello_world_publisher1.getSubscriberCount() >= 1
&& hello_world_publisher2.getSubscriberCount() >= 1)
{
break;
}
Expand Down Expand Up @@ -277,7 +282,9 @@ TEST(tcp_pubsub, multiple_subscribers_test)
// Wait up to 1 second for the subscriber to connect
for (int i = 0; i < 10; ++i)
{
if (hello_world_subscriber1.getSessions().at(0)->isConnected() && hello_world_subscriber2.getSessions().at(0)->isConnected())
if (hello_world_subscriber1.getSessions().at(0)->isConnected()
&& hello_world_subscriber2.getSessions().at(0)->isConnected()
&& hello_world_publisher.getSubscriberCount() >= 2)
{
break;
}
Expand Down

0 comments on commit 929cc4a

Please sign in to comment.