diff --git a/rclcpp/test/rclcpp/executors/test_executors.cpp b/rclcpp/test/rclcpp/executors/test_executors.cpp index 901806f3d2..f731f4b0e6 100644 --- a/rclcpp/test/rclcpp/executors/test_executors.cpp +++ b/rclcpp/test/rclcpp/executors/test_executors.cpp @@ -749,8 +749,8 @@ TYPED_TEST(TestExecutors, notifyTwiceWhileSpinning) this->publisher->publish(test_msgs::msg::Empty()); start = std::chrono::steady_clock::now(); while ( - sub1_msg_count == 1 && - sub2_msg_count == 0 && + (sub1_msg_count != 2 || + sub2_msg_count != 1) && (std::chrono::steady_clock::now() - start) < 10s) { std::this_thread::sleep_for(1ms);