-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add delay after node creation to ensure discovery for other rmw implementations #168
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BMarchi it's true that discovery latency makes it hard for us to write a robust test, but consider looping up to N times with a shorter timeout instead. It'll hopefully result in shorter run times.
…mentations Signed-off-by: Brian Ezequiel Marchi <brian.marchi65@gmail.com>
I was checking your suggestion @hidmic, but sometimes the test fails, even with my changes. Since we have to make retries and specify longer timeouts for |
sros2/test/sros2/commands/security/verbs/test_generate_policy.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Brian Ezequiel Marchi <brian.marchi65@gmail.com>
64f30c9
to
6aba460
Compare
I changed the test to start using launch_testing instead, take a look whenever you can @jacobperron , @hidmic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment below, otherwise LGTM
from ros2cli import cli | ||
|
||
|
||
def test_generate_policy_no_nodes(capsys): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that this PR resolves the previous test failure on Windows (#143).
We probably still want to keep the TODO and skip decorator. Note, to reproduce the failure, you should also run tests for packages other than sros2 (e.g. colcon test --packages-select demo_nodes_cpp && colcon test --packages-select sros2
).
Signed-off-by: Brian Ezequiel Marchi <brian.marchi65@gmail.com>
Signed-off-by: Brian Ezequiel Marchi <brian.marchi65@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but for a few nits.
sros2/test/sros2/commands/security/verbs/fixtures/pub_sub_node.py
Outdated
Show resolved
Hide resolved
sros2/test/sros2/commands/security/verbs/fixtures/client_service_node.py
Outdated
Show resolved
Hide resolved
sros2/test/sros2/commands/security/verbs/test_generate_policy.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Brian Ezequiel Marchi <brian.marchi65@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Re-runing CI up to |
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Rebased, refactored and used as a basis for #214. Closing. |
For connext, there were two issues:
When the
cli
command is run,sros2/sros2/test/sros2/commands/security/verbs/test_generate_policy.py
Lines 41 to 42 in c7ae64e
it runs in another thread/context, ending up here:
sros2/sros2/sros2/verb/generate_policy.py
Line 130 in c7ae64e
The culprit here, is the next portion of code:
https://github.com/ros2/rmw_connext/blob/b1062f92bfbec2e85be3083144a0f6c5a599287d/rmw_connext_shared_cpp/src/node_info_and_types.cpp#L104-L139
get_discovered_participants
from connext is returning 0 handlers, concluding that connext is not finding the previously created node in python.A timer is not ideal, but for testing purposes I see no other way to ensure the node's advertising.