Skip to content

Commit

Permalink
[humble] Fix for a false negative integration test with bag split in …
Browse files Browse the repository at this point in the history
…recorder (backport #1743) (#1751)

* Fix for a false negative integration test with bag split in recorder (#1743)

- In
record_end_to_end_with_splitting_bagsize_split_is_at_least_specified_size
publisher was starting after terminating recorder.

Signed-off-by: Michael Orlov <[email protected]>
(cherry picked from commit da1acb2)

# Conflicts:
#	rosbag2_tests/test/rosbag2_tests/test_rosbag2_record_end_to_end.cpp

* Address merge conflicts

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

---------

Signed-off-by: Michael Orlov <[email protected]>
Co-authored-by: Michael Orlov <[email protected]>
  • Loading branch information
mergify[bot] and MichaelOrlov authored Jul 19, 2024
1 parent 5a3cb80 commit 253a703
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,13 @@ TEST_F(RecordFixture, record_end_to_end_with_splitting_bagsize_split_is_at_least
ASSERT_TRUE(pub_manager.wait_for_matched(topic_name)) <<
"Expected find rosbag subscription";

pub_manager.run_publishers();

wait_for_db();

stop_execution(process_handle);
cleanup_process_handle.cancel();

pub_manager.run_publishers();

rosbag2_storage::MetadataIo metadata_io;

#ifdef _WIN32
Expand All @@ -357,10 +357,7 @@ TEST_F(RecordFixture, record_end_to_end_with_splitting_bagsize_split_is_at_least
const auto metadata = metadata_io.read_metadata(root_bag_path_.string());
const auto actual_splits = static_cast<int>(metadata.files.size());

// TODO(zmichaels11): Support reliable sync-to-disk for more accurate splits.
// The only guarantee with splits right now is that they will not occur until
// a bagfile is at least the specified max_bagfile_size.
EXPECT_GT(actual_splits, 0);
EXPECT_EQ(actual_splits, expected_splits);

// Don't include the last bagfile since it won't be full
for (int i = 0; i < actual_splits - 1; ++i) {
Expand Down

0 comments on commit 253a703

Please sign in to comment.