Skip to content

Commit

Permalink
Use get() instead of wait_for()
Browse files Browse the repository at this point in the history
Signed-off-by: Anas Abou Allaban <[email protected]>
  • Loading branch information
piraka9011 committed Apr 13, 2020
1 parent 2535ab1 commit 37cc76f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions rosbag2_transport/test/rosbag2_transport/test_play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,9 @@ TEST_F(RosBag2PlayQosOverrideTestFixture, topic_qos_profiles_overriden)

Rosbag2Transport rosbag2_transport{reader_, writer_, info_};
rosbag2_transport.play(storage_options_, play_options_);

using namespace std::chrono_literals;
// Avoid timeouts by only waiting for 3 seconds if no messages are received.
const auto future_result = await_received_messages.wait_for(3s);
EXPECT_EQ(future_result, std::future_status::ready);

await_received_messages.get();
rosbag2_transport.shutdown();

const auto received_messages =
sub_->get_received_messages<test_msgs::msg::BasicTypes>(topic_name_);
EXPECT_GT(received_messages.size(), 0u);
Expand Down

0 comments on commit 37cc76f

Please sign in to comment.