Skip to content

Commit

Permalink
Address race condition in rosbag2_py.test_record_cancel
Browse files Browse the repository at this point in the history
- Add `record_thread.join()` before trying to parse metadata.

Signed-off-by: Michael Orlov <[email protected]>
  • Loading branch information
MichaelOrlov committed Jun 12, 2023
1 parent c0b75eb commit 896d8b8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rosbag2_py/test/test_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 896d8b8

Please sign in to comment.