From 24afd4668415bdfa39d378fcfb4942fb41d5232f Mon Sep 17 00:00:00 2001 From: Andrea Sorbini Date: Wed, 27 Jan 2021 21:22:04 -0800 Subject: [PATCH 1/4] Reset arguments to rcl_get_node_names() on each test iteration. Signed-off-by: Andrea Sorbini --- rcl_action/test/rcl_action/test_graph.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rcl_action/test/rcl_action/test_graph.cpp b/rcl_action/test/rcl_action/test_graph.cpp index bb8be4465..ea237f18a 100644 --- a/rcl_action/test/rcl_action/test_graph.cpp +++ b/rcl_action/test/rcl_action/test_graph.cpp @@ -358,6 +358,14 @@ class TestActionGraphMultiNodeFixture : public CLASSNAME(TestActionGraphFixture, ret = rcl_get_node_names(&this->remote_node, allocator, &node_names, &node_namespaces); ++attempts; ASSERT_LE(attempts, max_attempts) << "Unable to attain all required nodes"; + if (node_names.size < 3u) { + ret = rcutils_string_array_fini(&node_names); + ASSERT_EQ(RCUTILS_RET_OK, ret); + ret = rcutils_string_array_fini(&node_namespaces); + ASSERT_EQ(RCUTILS_RET_OK, ret); + node_names = rcutils_get_zero_initialized_string_array(); + node_namespaces = rcutils_get_zero_initialized_string_array(); + } } } From d7ecefb438e1aa140b56ce30657fde68c3c47950 Mon Sep 17 00:00:00 2001 From: Andrea Sorbini Date: Fri, 5 Mar 2021 12:01:46 -0800 Subject: [PATCH 2/4] Replace rmw_connext_cpp with rmw_connextdds * Re-enable some tests that were previously disabled for Connext Signed-off-by: Andrea Sorbini --- rcl/test/CMakeLists.txt | 32 ++++------------------------ rcl/test/rcl/test_get_actual_qos.cpp | 5 +---- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/rcl/test/CMakeLists.txt b/rcl/test/CMakeLists.txt index be8ad3484..2dddece21 100644 --- a/rcl/test/CMakeLists.txt +++ b/rcl/test/CMakeLists.txt @@ -73,21 +73,12 @@ function(test_target_function) AMENT_DEPENDENCIES ${rmw_implementation} ) - # TODO(hidmic): re-enable timer tests against RTI Connext once - # https://github.com/ros2/rcl/issues/687 is resolved - set(AMENT_GTEST_ARGS "") - if(rmw_implementation STREQUAL "rmw_connext_cpp") - message(STATUS "Skipping test_timer${target_suffix} test.") - set(AMENT_GTEST_ARGS "SKIP_TEST") - endif() - rcl_add_custom_gtest(test_timer${target_suffix} SRCS rcl/test_timer.cpp ENV ${rmw_implementation_env_var} APPEND_LIBRARY_DIRS ${extra_lib_dirs} LIBRARIES ${PROJECT_NAME} osrf_testing_tools_cpp::memory_tools AMENT_DEPENDENCIES ${rmw_implementation} - ${AMENT_GTEST_ARGS} ) rcl_add_custom_gtest(test_context${target_suffix} @@ -122,16 +113,6 @@ function(test_target_function) AMENT_DEPENDENCIES ${rmw_implementation} "osrf_testing_tools_cpp" ) - set(AMENT_GTEST_ARGS "") - # TODO(wjwwood): remove this when the graph API works properly for connext dynamic - if(rmw_implementation STREQUAL "rmw_connext_dynamic_cpp") - message(STATUS "Skipping test_graph${target_suffix} test.") - set(AMENT_GTEST_ARGS "SKIP_TEST") - # TODO(mm318): why rmw_connext tests run much slower than rmw_fastrtps and rmw_opensplice tests - elseif(rmw_implementation STREQUAL "rmw_connext_cpp") - message(STATUS "Increasing test_graph${target_suffix} test timeout.") - set(AMENT_GTEST_ARGS TIMEOUT 180) - endif() rcl_add_custom_gtest(test_graph${target_suffix} SRCS rcl/test_graph.cpp ENV ${rmw_implementation_env_var} @@ -139,22 +120,14 @@ function(test_target_function) LIBRARIES ${PROJECT_NAME} AMENT_DEPENDENCIES ${rmw_implementation} "osrf_testing_tools_cpp" "test_msgs" TIMEOUT 120 - ${AMENT_GTEST_ARGS} ) - set(AMENT_GTEST_ARGS "") - # TODO(mm318): why rmw_connext tests run much slower than rmw_fastrtps and rmw_opensplice tests - if(rmw_implementation STREQUAL "rmw_connext_cpp") - message(STATUS "Increasing test_info_by_topic${target_suffix} test timeout.") - set(AMENT_GTEST_ARGS TIMEOUT 120) - endif() rcl_add_custom_gtest(test_info_by_topic${target_suffix} SRCS rcl/test_info_by_topic.cpp rcl/wait_for_entity_helpers.cpp ENV ${rmw_implementation_env_var} APPEND_LIBRARY_DIRS ${extra_lib_dirs} LIBRARIES ${PROJECT_NAME} AMENT_DEPENDENCIES ${rmw_implementation} "osrf_testing_tools_cpp" "test_msgs" - ${AMENT_GTEST_ARGS} ) rcl_add_custom_gtest(test_count_matched${target_suffix} @@ -254,8 +227,11 @@ function(test_target_function) LIBRARIES ${PROJECT_NAME} mimick AMENT_DEPENDENCIES ${rmw_implementation} "osrf_testing_tools_cpp" "test_msgs" ) + # TODO(asorbini) Enable message timestamp tests for rmw_connextdds on Windows + # once clock incompatibilities are resolved. if(rmw_implementation STREQUAL "rmw_fastrtps_cpp" OR - rmw_implementation STREQUAL "rmw_fastrtps_dynamic_cpp") + rmw_implementation STREQUAL "rmw_fastrtps_dynamic_cpp" OR + (rmw_implementation STREQUAL "rmw_connextdds" AND NOT WIN32)) message(STATUS "Enabling message timestamp test for ${rmw_implementation}") target_compile_definitions(test_subscription${target_suffix} PUBLIC "RMW_TIMESTAMPS_SUPPORTED=1" "RMW_RECEIVED_TIMESTAMP_SUPPORTED=1") diff --git a/rcl/test/rcl/test_get_actual_qos.cpp b/rcl/test/rcl/test_get_actual_qos.cpp index 15db5fe19..d4e4baf42 100644 --- a/rcl/test/rcl/test_get_actual_qos.cpp +++ b/rcl/test/rcl/test_get_actual_qos.cpp @@ -430,10 +430,7 @@ get_parameters(bool for_publisher) }); } } else { - if (rmw_implementation_str == "rmw_connext_cpp" || - rmw_implementation_str == "rmw_connext_dynamic_cpp" || - rmw_implementation_str == "rmw_opensplice_cpp") - { + if (rmw_implementation_str == "rmw_opensplice_cpp") { /* * Test with non-default settings. */ From 33595be0d3baecd554b421a2f50014ffef1a316b Mon Sep 17 00:00:00 2001 From: Andrea Sorbini Date: Mon, 8 Mar 2021 15:31:36 -0800 Subject: [PATCH 3/4] Remove references to OpenSplice Signed-off-by: Andrea Sorbini --- rcl/test/rcl/test_events.cpp | 1 - rcl/test/rcl/test_get_actual_qos.cpp | 31 ---------------------------- rcl/test/rcl/test_graph.cpp | 3 --- 3 files changed, 35 deletions(-) diff --git a/rcl/test/rcl/test_events.cpp b/rcl/test/rcl/test_events.cpp index d99bac84c..c4cdc1cda 100644 --- a/rcl/test/rcl/test_events.cpp +++ b/rcl/test/rcl/test_events.cpp @@ -606,7 +606,6 @@ TEST_F(TestEventFixture, test_pubsub_liveliness_kill_pub) /* * Basic test of publisher and subscriber incompatible qos callback events. - * Only implemented in opensplice at the moment. */ TEST_P(TestEventFixture, test_pubsub_incompatible_qos) { diff --git a/rcl/test/rcl/test_get_actual_qos.cpp b/rcl/test/rcl/test_get_actual_qos.cpp index d4e4baf42..0b7afc57d 100644 --- a/rcl/test/rcl/test_get_actual_qos.cpp +++ b/rcl/test/rcl/test_get_actual_qos.cpp @@ -429,37 +429,6 @@ get_parameters(bool for_publisher) "system_default_publisher_qos" }); } - } else { - if (rmw_implementation_str == "rmw_opensplice_cpp") { - /* - * Test with non-default settings. - */ - parameters.push_back( - { - nondefault_qos_profile(), - expected_nondefault_qos_profile(), - "nondefault_qos" - }); - - /* - * Test with system default settings. - */ - if (for_publisher) { - parameters.push_back( - { - rmw_qos_profile_system_default, - expected_system_default_publisher_qos_profile(), - "system_default_publisher_qos" - }); - } else { - parameters.push_back( - { - rmw_qos_profile_system_default, - expected_system_default_subscription_qos_profile(), - "system_default_publisher_qos" - }); - } - } } #endif diff --git a/rcl/test/rcl/test_graph.cpp b/rcl/test/rcl/test_graph.cpp index 9f9ed2504..bb49a1859 100644 --- a/rcl/test/rcl/test_graph.cpp +++ b/rcl/test/rcl/test_graph.cpp @@ -51,9 +51,6 @@ bool is_connext = std::string(rmw_get_implementation_identifier()).find("rmw_connext") == 0; -bool is_opensplice = - std::string(rmw_get_implementation_identifier()).find("rmw_opensplice") == 0; - class CLASSNAME (TestGraphFixture, RMW_IMPLEMENTATION) : public ::testing::Test { public: From eca1b0c1fdaa6131b55bd957d76a1b667051a1fc Mon Sep 17 00:00:00 2001 From: Andrea Sorbini Date: Mon, 8 Mar 2021 16:00:18 -0800 Subject: [PATCH 4/4] Restore exceptions for ros2/rmw_connext to ease transition to rticommunity/rmw_connextdds Signed-off-by: Andrea Sorbini --- rcl/test/CMakeLists.txt | 26 +++++++++++++++++++++ rcl/test/rcl/test_get_actual_qos.cpp | 34 ++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/rcl/test/CMakeLists.txt b/rcl/test/CMakeLists.txt index 2dddece21..c0561a385 100644 --- a/rcl/test/CMakeLists.txt +++ b/rcl/test/CMakeLists.txt @@ -73,12 +73,20 @@ function(test_target_function) AMENT_DEPENDENCIES ${rmw_implementation} ) + # TODO(asorbini): Remove these exceptions once ros2/rmw_connext is deprecated. + set(AMENT_GTEST_ARGS "") + if(rmw_implementation MATCHES "rmw_connext(.*)_cpp") + message(STATUS "Skipping test_timer${target_suffix} test.") + set(AMENT_GTEST_ARGS "SKIP_TEST") + endif() + rcl_add_custom_gtest(test_timer${target_suffix} SRCS rcl/test_timer.cpp ENV ${rmw_implementation_env_var} APPEND_LIBRARY_DIRS ${extra_lib_dirs} LIBRARIES ${PROJECT_NAME} osrf_testing_tools_cpp::memory_tools AMENT_DEPENDENCIES ${rmw_implementation} + ${AMENT_GTEST_ARGS} ) rcl_add_custom_gtest(test_context${target_suffix} @@ -113,6 +121,16 @@ function(test_target_function) AMENT_DEPENDENCIES ${rmw_implementation} "osrf_testing_tools_cpp" ) + # TODO(asorbini): Remove these exceptions once ros2/rmw_connext is deprecated. + set(AMENT_GTEST_ARGS "") + if(rmw_implementation STREQUAL "rmw_connext_dynamic_cpp") + message(STATUS "Skipping test_graph${target_suffix} test.") + set(AMENT_GTEST_ARGS "SKIP_TEST") + elseif(rmw_implementation STREQUAL "rmw_connext_cpp") + message(STATUS "Increasing test_graph${target_suffix} test timeout.") + set(AMENT_GTEST_ARGS TIMEOUT 180) + endif() + rcl_add_custom_gtest(test_graph${target_suffix} SRCS rcl/test_graph.cpp ENV ${rmw_implementation_env_var} @@ -120,8 +138,16 @@ function(test_target_function) LIBRARIES ${PROJECT_NAME} AMENT_DEPENDENCIES ${rmw_implementation} "osrf_testing_tools_cpp" "test_msgs" TIMEOUT 120 + ${AMENT_GTEST_ARGS} ) + # TODO(asorbini): Remove these exceptions once ros2/rmw_connext is deprecated. + set(AMENT_GTEST_ARGS "") + if(rmw_implementation MATCHES "rmw_connext(.*)_cpp") + message(STATUS "Increasing test_info_by_topic${target_suffix} test timeout.") + set(AMENT_GTEST_ARGS TIMEOUT 120) + endif() + rcl_add_custom_gtest(test_info_by_topic${target_suffix} SRCS rcl/test_info_by_topic.cpp rcl/wait_for_entity_helpers.cpp ENV ${rmw_implementation_env_var} diff --git a/rcl/test/rcl/test_get_actual_qos.cpp b/rcl/test/rcl/test_get_actual_qos.cpp index 0b7afc57d..f590867d4 100644 --- a/rcl/test/rcl/test_get_actual_qos.cpp +++ b/rcl/test/rcl/test_get_actual_qos.cpp @@ -429,6 +429,40 @@ get_parameters(bool for_publisher) "system_default_publisher_qos" }); } + } else { + // TODO(asorbini): Remove this block once ros2/rmw_connext is deprecated. + if (rmw_implementation_str == "rmw_connext_cpp" || + rmw_implementation_str == "rmw_connext_dynamic_cpp") + { + /* + * Test with non-default settings. + */ + parameters.push_back( + { + nondefault_qos_profile(), + expected_nondefault_qos_profile(), + "nondefault_qos" + }); + + /* + * Test with system default settings. + */ + if (for_publisher) { + parameters.push_back( + { + rmw_qos_profile_system_default, + expected_system_default_publisher_qos_profile(), + "system_default_publisher_qos" + }); + } else { + parameters.push_back( + { + rmw_qos_profile_system_default, + expected_system_default_subscription_qos_profile(), + "system_default_publisher_qos" + }); + } + } } #endif