Skip to content

Commit

Permalink
Fix the test failure of wrong messages count
Browse files Browse the repository at this point in the history
Generate rclcpp::Node before start_recording since rclcpp::Node will set
parameters of use_sim_time and publish message to parameter_events.
This will cause the wrong messages count in the test.

Signed-off-by: evshary <evshary@gmail.com>
  • Loading branch information
evshary committed Oct 8, 2019
1 parent 592d738 commit 8f5275d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ TEST_F(RecordIntegrationTestFixture, record_all_without_discovery_ignores_later_
auto string_message = get_messages_strings()[0];
string_message->string_value = "Hello World";

auto publisher_node = std::make_shared<rclcpp::Node>("publisher_for_test");

start_recording({true, true, {}, "rmw_format", 1ms});

std::this_thread::sleep_for(100ms);
auto publisher_node = std::make_shared<rclcpp::Node>("publisher_for_test");
auto publisher = publisher_node->create_publisher<test_msgs::msg::Strings>("/string_topic", 10);
for (int i = 0; i < 5; ++i) {
std::this_thread::sleep_for(20ms);
Expand Down

0 comments on commit 8f5275d

Please sign in to comment.