-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16362] Fix Windows StatistisQosTests.cpp linkage and Failed test #3122
Conversation
@richiprosima please test this |
{ | ||
const char* xml = | ||
" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes uncrustify resolves rules in a very weird manner. Nevertheless, I suggest keeping aligned the \
.
<dds xmlns=\"http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles\"> \ | ||
<profiles> \ | ||
<participant profile_name=\"statistics_participant\" is_default_profile=\"true\"> \ | ||
<rtps> \ | ||
<propertiesPolicy> \ | ||
<properties> \ | ||
<property> \ | ||
<name>fastdds.statistics</name> \ | ||
<value>HISTORY_LATENCY_TOPIC;PUBLICATION_THROUGHPUT_TOPIC;DATA_COUNT_TOPIC;DISCOVERY_TOPIC</value>\ | ||
</property> \ | ||
</properties> \ | ||
</propertiesPolicy> \ | ||
</rtps> \ | ||
</participant> \ | ||
<data_writer profile_name=\"HISTORY_LATENCY_TOPIC\"> \ | ||
<qos> \ | ||
<reliability> \ | ||
<kind>BEST_EFFORT</kind> \ | ||
</reliability> \ | ||
<durability> \ | ||
<kind>VOLATILE</kind> \ | ||
</durability> \ | ||
<publishMode> \ | ||
<kind>SYNCHRONOUS</kind> \ | ||
</publishMode> \ | ||
</qos> \ | ||
</data_writer> \ | ||
<data_writer profile_name=\"NETWORK_LATENCY_TOPIC\"> \ | ||
</data_writer> \ | ||
<data_writer profile_name=\"SUBSCRIPTION_THROUGHPUT_TOPIC\"> \ | ||
<qos> \ | ||
<reliability> \ | ||
<kind>BEST_EFFORT</kind> \ | ||
</reliability> \ | ||
<partition> \ | ||
<names> \ | ||
<name>part1</name> \ | ||
<name>part2</name> \ | ||
</names> \ | ||
</partition> \ | ||
<deadline> \ | ||
<period> \ | ||
<sec>3</sec> \ | ||
</period> \ | ||
</deadline> \ | ||
<latencyBudget> \ | ||
<duration> \ | ||
<sec>2</sec> \ | ||
</duration> \ | ||
</latencyBudget> \ | ||
<disable_heartbeat_piggyback>true</disable_heartbeat_piggyback> \ | ||
</qos> \ | ||
</data_writer> \ | ||
<data_writer profile_name=\"DATA_COUNT_TOPIC\"> \ | ||
<qos> \ | ||
<liveliness> \ | ||
<kind>AUTOMATIC</kind> \ | ||
<lease_duration> \ | ||
<sec>1</sec> \ | ||
<nanosec>856000</nanosec> \ | ||
</lease_duration> \ | ||
<announcement_period> \ | ||
<sec>1</sec> \ | ||
<nanosec>856000</nanosec> \ | ||
</announcement_period> \ | ||
</liveliness> \ | ||
</qos> \ | ||
</data_writer> \ | ||
<data_writer profile_name=\"HEARTBEAT_COUNT_TOPIC\"> \ | ||
<qos> \ | ||
<liveliness> \ | ||
<kind>AUTOMATIC</kind> \ | ||
<lease_duration> \ | ||
<sec>1</sec> \ | ||
<nanosec>856000</nanosec> \ | ||
</lease_duration> \ | ||
<announcement_period> \ | ||
<sec>1</sec> \ | ||
<nanosec>856000</nanosec> \ | ||
</announcement_period> \ | ||
</liveliness> \ | ||
</qos> \ | ||
</data_writer> \ | ||
<data_writer profile_name=\"OTHER_NAME_FOR_PROFILE\"> \ | ||
<qos> \ | ||
<reliability> \ | ||
<kind>BEST_EFFORT</kind> \ | ||
</reliability> \ | ||
</qos> \ | ||
</data_writer> \ | ||
<data_writer profile_name=\"DISCOVERY_TOPIC\"> \ | ||
<qos> \ | ||
<reliability> \ | ||
<kind>RELIABLE</kind> \ | ||
</reliability> \ | ||
</qos> \ | ||
</data_writer> \ | ||
</profiles> \ | ||
</dds> \ | ||
"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the alignment forced by uncrustify? I do not think so. I suggest modifying and using our tabulations rules (only 4 spaces between levels instead of the 8 being applied now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alignment was the one the file had before. However, I will apply a 4 indent for uniformity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I know it is legacy code, but in this way we strive to always be improving the code. 😄
" \ | ||
<?xml version=\"1.0\" encoding=\"utf-8\" ?> \ | ||
<dds xmlns=\"http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles\"> \ | ||
<profiles> \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<profiles>
tag should be indented with respect to <dds>
tag
{ | ||
const char* xml = | ||
" \ | ||
<?xml version=\"1.0\" encoding=\"utf-8\" ?> \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest aligning this first line with the "
in the line before. I do not think uncrustify will complain, though I am not completely sure.
<dds xmlns=\"http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles\"> \ | ||
<profiles> \ | ||
<participant profile_name=\"statistics_participant\" is_default_profile=\"true\"> \ | ||
<rtps> \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tag should be indented
<properties> \ | ||
<property> \ | ||
<name>fastdds.statistics</name> \ | ||
<value>HISTORY_LATENCY_TOPIC;PUBLICATION_THROUGHPUT_TOPIC;DATA_COUNT_TOPIC;DISCOVERY_TOPIC</value>\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line should be split to keep the alignment
@@ -341,7 +348,7 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo | |||
// it is just defined as data_writer profile. Thus, should not be created | |||
std::string subscription_througput_name = SUBSCRIPTION_THROUGHPUT_TOPIC; | |||
eprosima::fastdds::dds::DataWriter* subscription_througput_writer = | |||
statistics_publisher_impl->lookup_datawriter(subscription_througput_name); | |||
statistics_publisher->lookup_datawriter(subscription_througput_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it is not related to these changes, but I suggest fixing this typo:
statistics_publisher->lookup_datawriter(subscription_througput_name); | |
statistics_publisher->lookup_datawriter(subscription_throughput_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this previous suggestion was overlooked 😅
<properties> \ | ||
<property> \ | ||
<name>fastdds.statistics</name> \ | ||
<value>HISTORY_LATENCY_TOPIC;PUBLICATION_THROUGHPUT_TOPIC;DATA_COUNT_TOPIC;DISCOVERY_TOPIC</value>\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am missing some cases that were tested with the second XML file:
- Check that it worked without using the alias and using directly the topic name (both setting the property as the profile name being used in that specific topic).
- The
GENERIC_STATISTICS_PROFILE
is not being tested applying these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the next commit, I have rewritten the tests in a (i think) more elegant way. Instead of creating two files and point them from the environment, I use directly the load_XML_profiles_string() so it is clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably when the original code was implemented, the option of loading the XML profiles directly from a string was not implemented. As you say, now that this feature is included with Fast DDS it makes more sense. Thank you!
test_statistics_domain_participant_impl->get_publisher_impl(); | ||
ASSERT_NE(_statistics_publisher_impl, nullptr); | ||
// Get Publisher | ||
_statistics_publisher = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it is not related to the changes but I think we should unify the code style according to Fast DDS guidestyle. Private class member should have a trailing underscore, but there is no rule to add underscore before the variable name.
Related to the checklist:
|
I have build in Windows and the linking issue is solved (CI does not test with |
…tests so that not file creation needed. Applied requested changes. Signed-off-by: Mario Dominguez <[email protected]>
Note: StatisticsQosTests have to be run individually (as in the ci). Re-written both tests under StatisticsFromXMLProfileTests so that no file creation is needed. |
@richiprosima please test this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small nitpicks
@@ -341,7 +348,7 @@ TEST_F(StatisticsFromXMLProfileTests, XMLConfigurationForStatisticsDataWritersQo | |||
// it is just defined as data_writer profile. Thus, should not be created | |||
std::string subscription_througput_name = SUBSCRIPTION_THROUGHPUT_TOPIC; | |||
eprosima::fastdds::dds::DataWriter* subscription_througput_writer = | |||
statistics_publisher_impl->lookup_datawriter(subscription_througput_name); | |||
statistics_publisher->lookup_datawriter(subscription_througput_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this previous suggestion was overlooked 😅
<properties> \ | ||
<property> \ | ||
<name>fastdds.statistics</name> \ | ||
<value>HISTORY_LATENCY_TOPIC;PUBLICATION_THROUGHPUT_TOPIC;DISCOVERY_TOPIC;</value>\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of the alias it would be nice to have one check with the topic name directly, as it was done before: instead of DISCOVERY_TOPIC
, use _fastdds_statistics_discovered_entity
. This apply also in the corresponding profile.
Signed-off-by: Mario Dominguez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@Mergifyio backport 2.8.x |
✅ Backports have been created
|
* Refs #16362: Fix Windows StatistisQosTests.cpp linkage and rewritten tests so that not file creation needed. Applied requested changes. Signed-off-by: Mario Dominguez <[email protected]> * Refs #16362: Applied requested changes Signed-off-by: Mario Dominguez <[email protected]> Signed-off-by: Mario Dominguez <[email protected]> (cherry picked from commit 5926ee8)
Description
This PR intends to fix the StatisticsQosTests windows linkage issue. In addition, it fixes a test that tried to read a second xml profiles file with some profiles names shared with the first one, consequently, it was being ignored because of the bool flag default_xml_profiles_loaded in DomainParticipantFactory.
Proposed solution: Change the usage of ParticipantImpl to Participant (user api) to prevent linkage problems and unify all xml profiles from both files into a single one.
Contributor Checklist
N/A Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added.
N/A Any new/modified methods have been properly documented using Doxygen.
N/A Documentation builds and tests pass locally.
N/A New feature has been added to the
versions.md
file (if applicable).N/A New feature has been documented/Current behavior is correctly described in the documentation.
Reviewer Checklist