From 45303b8da5dd09c5ef669654fedb54f82687a3ab Mon Sep 17 00:00:00 2001 From: Michael Orlov Date: Mon, 12 Jun 2023 15:15:01 -0700 Subject: [PATCH] Address race condition in rosbag2_py.test_record_cancel - Add `record_thread.join()` before trying to parse metadata. Signed-off-by: Michael Orlov --- rosbag2_py/test/test_transport.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rosbag2_py/test/test_transport.py b/rosbag2_py/test/test_transport.py index 345cb1323b..548708d409 100644 --- a/rosbag2_py/test/test_transport.py +++ b/rosbag2_py/test/test_transport.py @@ -80,6 +80,7 @@ def test_record_cancel(tmp_path, storage_id): metadata_io = rosbag2_py.MetadataIo() assert wait_for(lambda: metadata_io.metadata_file_exists(bag_path), timeout=rclpy.duration.Duration(seconds=3)) + record_thread.join() metadata = metadata_io.read_metadata(bag_path) assert(len(metadata.relative_file_paths))