@@ -76,8 +76,7 @@ TEST_F(TestExecutorNotifyWaitable, wait) {
7676 std::make_shared<rclcpp::executors::ExecutorNotifyWaitable>(on_execute_callback);
7777
7878 auto node = std::make_shared<rclcpp::Node>(" my_node" , " /ns" );
79- auto notify_guard_condition =
80- node->get_node_base_interface ()->get_shared_notify_guard_condition ();
79+ auto notify_guard_condition = std::make_shared<rclcpp::GuardCondition>();
8180 EXPECT_NO_THROW (waitable->add_guard_condition (notify_guard_condition));
8281
8382 auto default_cbg = node->get_node_base_interface ()->get_default_callback_group ();
@@ -86,12 +85,15 @@ TEST_F(TestExecutorNotifyWaitable, wait) {
8685 auto waitables = node->get_node_waitables_interface ();
8786 waitables->add_waitable (std::static_pointer_cast<rclcpp::Waitable>(waitable), default_cbg);
8887
88+ // notify the guard condition, this should trigger the on_execute_callback
89+ notify_guard_condition->trigger ();
90+
8991 rclcpp::executors::SingleThreadedExecutor executor;
9092 executor.add_node (node);
9193 executor.spin_all (std::chrono::seconds (1 ));
9294 EXPECT_EQ (1u , on_execute_calls);
9395
94- // on_execute_callback doesn't change if the topology doesn't change
96+ // no further trigger, therefore no further callback
9597 executor.spin_all (std::chrono::seconds (1 ));
9698 EXPECT_EQ (1u , on_execute_calls);
9799}
0 commit comments