Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zenoh: Increased timeout for test_rcl_lifecycle #1185

Closed
wants to merge 1 commit into from

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented Sep 18, 2024

No description provided.

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@@ -104,6 +104,7 @@ if(BUILD_TESTING)
endif()
ament_add_gtest(test_rcl_lifecycle
test/test_rcl_lifecycle.cpp
TIMEOUT 400
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

400 secs is the longest timeout for the test in rcl...

with my local environment with rmw_fastrtps_cpp, it can complete the test in 3 seconds.

root@tomoyafujita:~/ros2_ws/colcon_ws# colcon test --event-handlers console_direct+ --packages-select rcl_lifecycle --ctest-args -R test_rcl_lifecycle
...
The following tests passed:
        test_rcl_lifecycle

100% tests passed, 0 tests failed out of 1

Label Time Summary:
gtest    =   1.81 sec*proc (1 test)

Total Test time (real) =   1.81 sec
Finished <<< rcl_lifecycle [2.48s]

Summary: 1 package finished [3.67s]

I am not sure if this is the correct thing to do... maybe something wrong with rmw_zenoh instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this is the correct thing to do... maybe something wrong with rmw_zenoh instead?

There is definitely a bug in rmw_zenoh that needs to be addressed here. In particular, it can take up to 1.5 seconds to complete a connection between rmw_zenoh and the router, and rmw_init is blocked during that time.

For reference, rmw_init in for example rmw_fastrtps returns in something like a millisecond, so the delta here is huge. We really need to fix rmw_zenoh/Zenoh proper to make this connection timeout much smaller.

@Yadunund
Copy link
Member

I haven't been able to reproduce this test failure on my machine with the latest rolling branches for both rmw_zenoh and this repo.

I run all the tests

colcon test --event-handlers console_direct+ --packages-select rcl_lifecycle 

On my machine the 4 gtests takes about 42 with rmw_zenoh/rolling

100% tests passed, 0 tests failed out of 10

Label Time Summary:
copyright     =   3.40 sec*proc (1 test)
cppcheck      =   0.51 sec*proc (1 test)
cpplint       =   1.21 sec*proc (1 test)
gtest         =  42.31 sec*proc (4 tests)
lint_cmake    =   0.46 sec*proc (1 test)
linter        =   7.36 sec*proc (6 tests)
uncrustify    =   0.59 sec*proc (1 test)
xmllint       =   1.18 sec*proc (1 test)

Total Test time (real) =  49.68 sec
Finished <<< rcl_lifecycle [51.0s]            

Summary: 1 package finished [52.6s]


With rmw_fastrtps, it takes 2s.

100% tests passed, 0 tests failed out of 10

Label Time Summary:
copyright     =   3.37 sec*proc (1 test)
cppcheck      =   0.48 sec*proc (1 test)
cpplint       =   1.18 sec*proc (1 test)
gtest         =   2.18 sec*proc (4 tests)
lint_cmake    =   0.46 sec*proc (1 test)
linter        =   6.91 sec*proc (6 tests)
uncrustify    =   0.59 sec*proc (1 test)
xmllint       =   0.82 sec*proc (1 test)

Total Test time (real) =   9.09 sec
Finished <<< rcl_lifecycle [10.4s]            

Summary: 1 package finished [11.9s]

I opened ros2/rmw_zenoh#284 to reduce the sleep in rmw_init in rmw_zenoh and now the test only takes 30s with rmw_zenoh.

100% tests passed, 0 tests failed out of 10

Label Time Summary:
copyright     =   3.39 sec*proc (1 test)
cppcheck      =   0.50 sec*proc (1 test)
cpplint       =   1.18 sec*proc (1 test)
gtest         =  30.20 sec*proc (4 tests)
lint_cmake    =   0.47 sec*proc (1 test)
linter        =   7.03 sec*proc (6 tests)
uncrustify    =   0.60 sec*proc (1 test)
xmllint       =   0.89 sec*proc (1 test)

Total Test time (real) =  37.24 sec
Finished <<< rcl_lifecycle [38.5s]            

Summary: 1 package finished [40.1s]

It's a slight improvement. @ahcorde could you confirm that this test still fails on rolling for your and if so, does my PR improve the situation?

@ahcorde
Copy link
Contributor Author

ahcorde commented Sep 25, 2024

Thank you @Yadunund !

@ahcorde ahcorde closed this Sep 25, 2024
@Yadunund Yadunund deleted the ahcorde/rolling/rcl_lifecyle_timeout branch September 25, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants