rosbag2 icon indicating copy to clipboard operation
rosbag2 copied to clipboard

Resolve workarounds in rosbag2_tests for Windows

Open zmichaels11 opened this issue 5 years ago • 3 comments

test_rosbag2_record_end_to_end defines a workaround for Windows in multiple places due to Windows not supporting a mechanism to programmatically send a SIGINT.

These tests should either be rewritten to not require the workaround or a helper function should be written so less platform-specific code is required.

zmichaels11 avatar Jan 28 '20 00:01 zmichaels11

I have created a Pytest that can successfully execute a ros2bag CLI command and send a CTRL_C_EVENT to gracefully terminate it. The issue is that when I run it with colcon test the CTRL_C_EVENT aborts the colcon test command as well.

I opened an issue (colcon/colcon-core#303) to discuss why this is the case and propose a path forward.

An potential approach in the future would be to use stdin pipes to communicate with the ros2bag command via keyboard events if that feature is developed.

piraka9011 avatar Feb 07 '20 18:02 piraka9011

As per our discussion yesterday, it might make sense to rewrite the e2e tests in Python and use launch_testing. (Also brought up in ros-tooling meeting) Similar problem happened in Gazebo project.

zmichaels11 avatar Feb 14 '20 17:02 zmichaels11

I think one helpful addition would be to introduce a close function to the final Reader and Writer class. The closing function is generally provoked via the destructor, which works well as long as you don't try to ctrl-c on Windows. Having a public function for this would allow us to manually trigger this within the tests before ctrl-c.

Karsten1987 avatar Jul 01 '20 23:07 Karsten1987

  • Closing as a stale issue.
  • The helper functions are already inplace, and tests will be rewritten to be able to send analog of the CTL+C on Windows in the scope of the https://github.com/ros2/rosbag2/pull/1342

MichaelOrlov avatar Jul 13 '24 07:07 MichaelOrlov