You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function may return false indicating the time was not completed, is it there any way we can change the test to reflect this? or am I missing something?
Expected Behavior
Test passes.
Actual Behavior
Test fails in the repeated jobs buildfarm.
System (please complete the following information)
OS: Windows
ROS 2 Distro: Rolling
Version: main
The text was updated successfully, but these errors were encountered:
It's ok from design and our API point of view if our sleep_until(rcutils_time_point_value_t until) will periodically wake up and return false as long as it respect target sleep time.
Although we can take it in to account in test. Something like this:
clock.pause();
clock.resume();
auto sleep_until_timestamp = clock.now() + RCUTILS_S_TO_NS(1);
auto start = std::chrono::steady_clock::now();
bool sleep_result = clock.sleep_until(sleep_until_timestamp);
// clock.sleep_until can periodically wake up and return false. Check for true in time constrainwhile (rclcpp::ok() && !sleep_result &&
(std::chrono::steady_clock::now() - start) < std::chrono::milliseconds(1200))
{
sleep_result = clock.sleep_until(sleep_until_timestamp);
}
auto end = std::chrono::steady_clock::now();
EXPECT_TRUE(end - start < std::chrono::milliseconds(1200));
EXPECT_TRUE(end - start >= std::chrono::seconds(1));
EXPECT_TRUE(sleep_result);
@MichaelOrlov To me it makes total sense to rewrite the test using the snippet of code you attached, it better reflects the usage of the API. Thanks for digging into this!
Let me know if you can open a PR with this (so the code gets merged with you as author) or if you'd prefer me to handle it.
@Blast545 I would appreciate if you would do it by yourself.
I don't mind about who will be authoring it.
I am honestly have a lot on my plate and can't keep up with all tasks which need to do.
Description
This test is failing in the repeated jobs of the buildfarm:
https://ci.ros2.org/view/nightly/job/nightly_win_rep/2588/testReport/junit/rosbag2_cpp/TimeControllerClockTest/unpaused_sleep_returns_true/
This is the code of the test:
rosbag2/rosbag2_cpp/test/rosbag2_cpp/test_time_controller_clock.cpp
Line 154 in 5fa3a67
From what I can see in the API,
rosbag2/rosbag2_cpp/include/rosbag2_cpp/clocks/time_controller_clock.hpp
Line 70 in 5fa3a67
The function may return false indicating the time was not completed, is it there any way we can change the test to reflect this? or am I missing something?
Expected Behavior
Test passes.
Actual Behavior
Test fails in the repeated jobs buildfarm.
System (please complete the following information)
The text was updated successfully, but these errors were encountered: