Skip to content

Commit

Permalink
Refs #22658: Regression test
Browse files Browse the repository at this point in the history
Signed-off-by: Juanjo Garcia <[email protected]>
  • Loading branch information
juanjo4936 committed Jan 28, 2025
1 parent 9ddad46 commit 034f674
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/blackbox/api/dds-pim/PubSubWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,14 @@ class PubSubWriter
return *this;
}

PubSubWriter& reliability(
const eprosima::fastdds::dds::ReliabilityQosPolicyKind kind, int max_blocking_time)
{
datawriter_qos_.reliability().kind = kind;
datawriter_qos_.reliability().max_blocking_time.seconds = max_blocking_time;
return *this;
}

PubSubWriter& mem_policy(
const eprosima::fastdds::rtps::MemoryManagementPolicy mem_policy)
{
Expand Down
38 changes: 38 additions & 0 deletions test/blackbox/common/DDSBlackboxTestsListeners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3436,6 +3436,44 @@ TEST(DDSStatus, keyed_reliable_positive_acks_disabled_on_unack_sample_removed)
delete dummy_data;
}

/*!
* Regression Test for 22658: when he entire history is acked in volatile, given that the entries are deleted from the
* history, check_acked_status satisfies min_low_mark >= get_seq_num_min() because seq_num_min is unknown. This makes
* try_remove to fail, because it tries to remove changes but there were none. This causes prepare_change to not
* perform the changes, since the history was full and could not delete any changes.
*/

TEST(DDSStatus, entire_history_acked_volatile_unknown_pointer)
{
PubSubWriter<HelloWorldPubSubType> writer(TEST_TOPIC_NAME);
PubSubReader<HelloWorldPubSubType> reader(TEST_TOPIC_NAME);

writer.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS, 200)
.durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS)
.history_kind(eprosima::fastdds::dds::KEEP_ALL_HISTORY_QOS)
.resource_limits_max_instances(1)
.resource_limits_max_samples(1)
.resource_limits_max_samples_per_instance(1)
.init();
ASSERT_TRUE(writer.isInitialized());

reader.reliability(eprosima::fastdds::dds::RELIABLE_RELIABILITY_QOS)
.durability_kind(eprosima::fastdds::dds::VOLATILE_DURABILITY_QOS)
.init();
ASSERT_TRUE(reader.isInitialized());

// Wait for discovery
writer.wait_discovery();
reader.wait_discovery();

auto data = default_helloworld_data_generator(2);

for (auto sample : data)
{
EXPECT_TRUE(writer.send_sample(sample));
}
}

/*!
* Test that checks with a writer of each type that having the same listener attached, the notified writer in the
* callback is the corresponding writer that has removed a sample unacknowledged.
Expand Down

0 comments on commit 034f674

Please sign in to comment.