Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Sanchez <[email protected]>
  • Loading branch information
danielsanchezaran committed Nov 29, 2024
1 parent 80d61d6 commit 155d4dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common/autoware_universe_utils/src/system/time_keeper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void TimeKeeper::start_track(const std::string & func_name)
} else {
if (root_node_thread_id_ != std::this_thread::get_id()) {
const auto warning_msg = fmt::format(
"TimeKeeper::start_track({}) is called from a different thread. Ignoring the call",
"TimeKeeper::start_track({}) is called from a different thread. Ignoring the call.",
func_name);
RCLCPP_WARN(rclcpp::get_logger("TimeKeeper"), "%s", warning_msg.c_str());
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ TEST_F(TimeKeeperTest, MultiThreadWarning)
t.join();

std::string err = testing::internal::GetCapturedStderr();
EXPECT_TRUE(
err.find("TimeKeeper::start_track() is called from a different thread. Ignoring the call.") !=
std::string::npos);
const bool error_found = err.find(
"TimeKeeper::start_track(MainFunction) is called from a different "
"thread. Ignoring the call.") != std::string::npos ||
err.find(
"TimeKeeper::start_track(ThreadFunction) is called from a different "
"thread. Ignoring the call.") != std::string::npos;
EXPECT_TRUE(error_found);
}

0 comments on commit 155d4dc

Please sign in to comment.