Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jazzy] Bugfix for wrong timestamps in ros2 bag info (backport #1745) #1752

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Jul 19, 2024

Correctly calculate the fractional part for seconds by subtracting nanoseconds_from_seconds from nanoseconds.

The changes covered by

TEST_P(InfoEndToEndTestFixture, info_end_to_end_test) {
internal::CaptureStdout();
auto exit_code = execute_and_wait_until_completion("ros2 bag info cdr_test", bags_path_);
std::string output = internal::GetCapturedStdout();
auto expected_storage = GetParam();
auto expected_file = rosbag2_test_common::bag_filename_for_storage_id("cdr_test_0", GetParam());
std::string expected_ros_distro = "unknown";
EXPECT_THAT(exit_code, Eq(EXIT_SUCCESS));
// The bag size depends on the os and is not asserted, the time is asserted time zone independent
EXPECT_THAT(
output, ContainsRegex(
"\nFiles: " + expected_file +
"\nBag size: .*B"
"\nStorage id: " + expected_storage +
"\nROS Distro: " + expected_ros_distro +
"\nDuration: 0.151137181s"
"\nStart: Apr .+ 2020 .*:.*:36.763032325 \\(1586406456.763032325\\)"
"\nEnd: Apr .+ 2020 .*:.*:36.914169506 \\(1586406456.914169506\\)"
"\nMessages: 7"
"\nTopic information: "));

* Bugfix for wrong timestamps in ros2 bag info

- Correctly calculate fractional part for seconds by subtracting
`nanoseconds_from_seconds` from `nanoseconds`.

Signed-off-by: Michael Orlov <[email protected]>

* Adjust expectations in the "ros2 bag info" integration tests

Signed-off-by: Michael Orlov <[email protected]>

* Add leading zeros to the fractional seconds in the format_duration(..)

Signed-off-by: Michael Orlov <[email protected]>

* Adjust expectations in info end-to-end tests by adding leading zero

The real file duration is: 70633730 nanoseconds.
i.e., regex mask shall be "0\\.0706.*s" to match 070633730 nanoseconds.

Signed-off-by: Michael Orlov <[email protected]>

---------

Signed-off-by: Michael Orlov <[email protected]>
(cherry picked from commit da28c9d)
@mergify mergify bot requested a review from a team as a code owner July 19, 2024 02:49
@mergify mergify bot requested review from gbiggs and jhdcs and removed request for a team July 19, 2024 02:49
@MichaelOrlov MichaelOrlov changed the title Bugfix for wrong timestamps in ros2 bag info (backport #1745) [jazzy] Bugfix for wrong timestamps in ros2 bag info (backport #1745) Jul 19, 2024
@MichaelOrlov
Copy link
Contributor

Pulls: #1752
Gist: https://gist.githubusercontent.com/MichaelOrlov/607a1d168b95c1d8fdb452ecffb0b81e/raw/74ca8da40f7e32fc8cc52305fa215f303535236d/ros2.repos
BUILD args: --packages-above-and-dependencies rosbag2_py rosbag2_tests
TEST args: --packages-above rosbag2_py rosbag2_tests
ROS Distro: jazzy
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14262

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@MichaelOrlov MichaelOrlov merged commit cf268d8 into jazzy Jul 19, 2024
14 checks passed
@mergify mergify bot deleted the mergify/bp/jazzy/pr-1745 branch July 19, 2024 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant