Skip to content

Commit 4567b6e

Browse files
authored
Fixed test_events_executors in zenoh (#2643)
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
1 parent 0be8aa0 commit 4567b6e

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

rclcpp/test/rclcpp/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ if(TARGET test_executor_notify_waitable)
555555
target_link_libraries(test_executor_notify_waitable ${PROJECT_NAME} mimick rcpputils::rcpputils)
556556
endif()
557557

558-
ament_add_gtest(test_events_executor executors/test_events_executor.cpp TIMEOUT 5)
558+
ament_add_gtest(test_events_executor executors/test_events_executor.cpp TIMEOUT 60)
559559
if(TARGET test_events_executor)
560560
target_link_libraries(test_events_executor ${PROJECT_NAME} ${test_msgs_TARGETS})
561561
endif()

rclcpp/test/rclcpp/executors/test_events_executor.cpp

+15-8
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,21 @@ TEST_F(TestEventsExecutor, test_default_incompatible_qos_callbacks)
479479
const auto timeout = std::chrono::seconds(10);
480480
ex.spin_until_future_complete(log_msgs_future, timeout);
481481

482-
EXPECT_EQ(
483-
"New subscription discovered on topic '/test_topic', requesting incompatible QoS. "
484-
"No messages will be sent to it. Last incompatible policy: DURABILITY_QOS_POLICY",
485-
pub_log_msg);
486-
EXPECT_EQ(
487-
"New publisher discovered on topic '/test_topic', offering incompatible QoS. "
488-
"No messages will be sent to it. Last incompatible policy: DURABILITY_QOS_POLICY",
489-
sub_log_msg);
482+
rclcpp::QoSCheckCompatibleResult qos_compatible = rclcpp::qos_check_compatible(
483+
publisher->get_actual_qos(), subscription->get_actual_qos());
484+
if (qos_compatible.compatibility == rclcpp::QoSCompatibility::Error) {
485+
EXPECT_EQ(
486+
"New subscription discovered on topic '/test_topic', requesting incompatible QoS. "
487+
"No messages will be sent to it. Last incompatible policy: DURABILITY_QOS_POLICY",
488+
pub_log_msg);
489+
EXPECT_EQ(
490+
"New publisher discovered on topic '/test_topic', offering incompatible QoS. "
491+
"No messages will be sent to it. Last incompatible policy: DURABILITY_QOS_POLICY",
492+
sub_log_msg);
493+
} else {
494+
EXPECT_EQ("", pub_log_msg);
495+
EXPECT_EQ("", sub_log_msg);
496+
}
490497

491498
rcutils_logging_set_output_handler(original_output_handler);
492499
}

0 commit comments

Comments
 (0)