Skip to content

Commit

Permalink
Refs #20584: Fix PubSubParticipant comparison and add padding between…
Browse files Browse the repository at this point in the history
… writer announcement period and lease duration test's writers

Signed-off-by: Mario Dominguez <[email protected]>
  • Loading branch information
Mario-DL authored and EduPonz committed Mar 20, 2024
1 parent 33ebb96 commit 85c5d4d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/blackbox/api/dds-pim/PubSubParticipant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ class PubSubParticipant
std::unique_lock<std::mutex> lock(sub_liveliness_mutex_);
sub_liveliness_cv_.wait_for(lock, max_wait, [this, &expected_num_lost]() -> bool
{
return expected_num_lost >= sub_times_liveliness_lost_;
return sub_times_liveliness_lost_ >= expected_num_lost;
});

return sub_times_liveliness_lost_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ class PubSubParticipant
std::unique_lock<std::mutex> lock(sub_liveliness_mutex_);
sub_liveliness_cv_.wait_for(lock, max_wait, [this, &expected_num_lost]() -> bool
{
return expected_num_lost >= sub_times_liveliness_lost_;
return sub_times_liveliness_lost_ >= expected_num_lost;
});

return sub_times_liveliness_lost_;
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox/common/BlackboxTestsLivelinessQos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1977,13 +1977,13 @@ TEST(LivelinessTests, Reader_Successfully_Asserts_Liveliness_on_a_Disconnected_W
.add_user_transport_to_pparams(testTransport)
.liveliness_lease_duration(eprosima::fastrtps::Time_t(1, 0))
.liveliness_kind(eprosima::fastdds::dds::AUTOMATIC_LIVELINESS_QOS)
.liveliness_announcement_period(eprosima::fastrtps::Time_t(0, 900000000))
.liveliness_announcement_period(eprosima::fastrtps::Time_t(0, 500000000))
.init();

writer_2.lease_duration(c_TimeInfinite, 1)
.liveliness_lease_duration(eprosima::fastrtps::Time_t(1, 0))
.liveliness_kind(eprosima::fastdds::dds::AUTOMATIC_LIVELINESS_QOS)
.liveliness_announcement_period(eprosima::fastrtps::Time_t(0, 900000000))
.liveliness_announcement_period(eprosima::fastrtps::Time_t(0, 500000000))
.init();

// Wait for discovery to occur. Liveliness should be recovered twice,
Expand Down

0 comments on commit 85c5d4d

Please sign in to comment.