ros2 / demos

Apache License 2.0
493 stars 329 forks source link

Long sleep time for the execution of each demo test case #628

Closed Barry-Xu-2018 closed 1 year ago

Barry-Xu-2018 commented 1 year ago

Bug report

Required Info:

Steps to reproduce issue

$ colcon test --packages-select demo_nodes_cpp --event-handlers console_direct+

Expected behavior

Not spend much time for each test

Actual behavior

Consumed time for each test is more than 5 second e.g.

     Start  1: test_tutorial_content_filtering_publisher_content_filtering_subscriber__rmw_cyclonedds_cpp
      ...
1: Ran 1 test in 31.032s
      Start  2: test_tutorial_list_parameters_async__rmw_cyclonedds_cpp
      ...
2: Ran 1 test in 5.031s
      Start  3: test_tutorial_list_parameters__rmw_cyclonedds_cpp
      ...
3: Ran 1 test in 5.036s
      Start  4: test_tutorial_parameter_events_async__rmw_cyclonedds_cpp
      ...
4: Ran 1 test in 5.237s
      Start  5: test_tutorial_parameter_events__rmw_cyclonedds_cpp
      ...
5: Ran 1 test in 5.034s
      Start  6: test_tutorial_set_and_get_parameters_async__rmw_cyclonedds_cpp
      ...
6: Ran 1 test in 5.034s
      Start  7: test_tutorial_set_and_get_parameters__rmw_cyclonedds_cpp
      ...
7: Ran 1 test in 5.038s
      Start  8: test_tutorial_matched_event_detect__rmw_cyclonedds_cpp
      ...
8: Ran 1 test in 5.042s
      Start  9: test_tutorial_use_logger_service__rmw_cyclonedds_cpp
      ...
9: Ran 1 test in 5.838s
      Start 10: test_tutorial_talker_listener__rmw_cyclonedds_cpp
      ...
10: Ran 1 test in 6.032s
      Start 11: test_tutorial_add_two_ints_server_add_two_ints_client__rmw_cyclonedds_cpp
      ...
11: Ran 1 test in 5.043s
      Start 12: test_tutorial_add_two_ints_server_add_two_ints_client_async__rmw_cyclonedds_cpp
      ...
12: Ran 1 test in 5.031s

Additional information

Current test framework includes sleep operation

https://github.com/ros2/demos/blob/74738d8e269c8cb7df73a581a9dab7cfc666fdfe/demo_nodes_cpp/test/test_executables_tutorial.py.in#L66-L70