Skip to content

Commit

Permalink
Refs #20584: Apply reviewer suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
  • Loading branch information
Mario-DL authored and EduPonz committed Mar 20, 2024
1 parent cd799a0 commit 33ebb96
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion include/fastdds/rtps/writer/LivelinessManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ class LivelinessManager
Duration_t lease_duration);

/**
* @brief Asserts liveliness of writers with given liveliness kind
* @brief Asserts liveliness of writers with given liveliness kind and GuidPrefix
* @param kind Liveliness kind
* @param guid_prefix The guid prefix of the writers to assert liveliness of
* @return True if liveliness was successfully asserted
*/
bool assert_liveliness(
Expand Down
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 expected_num_lost >= sub_times_liveliness_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 expected_num_lost >= sub_times_liveliness_lost_;
});

return sub_times_liveliness_lost_;
Expand Down
4 changes: 3 additions & 1 deletion test/blackbox/common/BlackboxTestsLivelinessQos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1973,13 +1973,15 @@ TEST(LivelinessTests, Reader_Successfully_Asserts_Liveliness_on_a_Disconnected_W

// Create writers
writer_1.disable_builtin_transport()
.lease_duration(c_TimeInfinite, 1)
.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))
.init();

writer_2.liveliness_lease_duration(eprosima::fastrtps::Time_t(1, 0))
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))
.init();
Expand Down

0 comments on commit 33ebb96

Please sign in to comment.