ros2 / examples

Example packages for ROS 2
Apache License 2.0
681 stars 308 forks source link

Refactor WaitForNodes class. #373

Closed clalancette closed 4 months ago

clalancette commented 4 months ago

The main goal here is to get rid of the sometimes flaky tests we are seeing in the nightlies. To do that, we try increasing the default timeout from 10 to 15 seconds.

While we are in here, do a few other pieces of refactoring in this test:

  1. Use a common variable name for the node name.
  2. Switch the variable name for the loop to 'finished', which better reflects what it is doing.
  3. Change the sleep between loops to 0.1, so we react faster
  4. Remove the unnecessary _prepare_node() method.

I think this should make the flaky test as in https://ci.ros2.org/view/nightly/job/nightly_linux_debug/2978/testReport/junit/launch_testing_examples.launch_testing_examples/check_multiple_nodes_launch_test/launch_testing_examples_check_multiple_nodes_launch_test/ less flaky.