Skip to content

Add a warning to ros2 node info when there is more than one node with the same name#463

Merged
hidmic merged 4 commits intoros2:masterfrom
aws-ros-dev:emersonknapp/nodeinfo_nonunique
Mar 13, 2020
Merged

Add a warning to ros2 node info when there is more than one node with the same name#463
hidmic merged 4 commits intoros2:masterfrom
aws-ros-dev:emersonknapp/nodeinfo_nonunique

Conversation

@emersonknapp
Copy link
Contributor

Second half of #453
Second half of https://github.com/ros-tooling/aws-roadmap/issues/196

Add a simple warning for ros2 node info when there is more than one node with the same name. This does not change functionality at all, just informs users of a potentially confusing situation.

Signed-off-by: Emerson Knapp emerson.b.knapp@gmail.com

@emersonknapp
Copy link
Contributor Author

@chapulina ping for routing to the correct reviewers

@chapulina chapulina requested a review from dirk-thomas March 2, 2020 22:34
@dirk-thomas dirk-thomas removed their request for review March 2, 2020 22:38
Copy link
Contributor

@hidmic hidmic left a 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 minor nits. It'd be nice to have a test for it though :)

@emersonknapp
Copy link
Contributor Author

@hidmic I've added a test to expect this warning line output in a launch scenario with this node. I was thinking of adding an inverse test, "this line is not present when running against a normal node" - but I couldn't think of how to do that "expectation of absence" - any ideas? Also, maybe it's not necessary because the existing tests handle the regular-case scenario. What do you think?

@thomas-moulard thomas-moulard mentioned this pull request Mar 4, 2020
3 tasks
@emersonknapp
Copy link
Contributor Author

@hidmic can you review this?

Copy link
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

LGTM pending green CI ! Apologies for the rather long round-trip.

On testing for absence, considering it's a single text line you want to check for, simply negating expect_output(..., strict=False) outcome will do the trick.

@emersonknapp
Copy link
Contributor Author

@ros2/aws-oncall - please run this CI job
Gist: https://gist.githubusercontent.com/emersonknapp/3f56000a8f88a272334b7c4c2e53828d/raw/cecff37a502392f6efb96f404c5bdd96b31a2ad2/ros2.repos
BUILD args: --packages-up-to ros2node
TEST args: --packages-select ros2node
Job: ci_launcher

@emersonknapp
Copy link
Contributor Author

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

… the given name

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@emersonknapp emersonknapp force-pushed the emersonknapp/nodeinfo_nonunique branch from 0e4149c to 7b6f22c Compare March 10, 2020 21:25
@emersonknapp
Copy link
Contributor Author

emersonknapp commented Mar 10, 2020

Restarting after updating branch

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@emersonknapp
Copy link
Contributor Author

I've just learned that rmw_cyclonedds_cpp uses a std::set<> under the hood to return node names, so it will not return a list with multiple nodes of the same name, therefore these checks don't help us in CycloneDDS - @hidmic do you have thoughts on this? I'm wondering if I should go in and change the rmw_cyclonedds_cpp implementation to use a std::vector instead, or if we should disable these tests for Cylone, or a third option (don't print this warning?)

@emersonknapp
Copy link
Contributor Author

emersonknapp commented Mar 12, 2020

After updating rmw_cyclonedds to provide nodes with duplicate names

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

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

one nitpick, otherwise lgtm

Co-Authored-By: William Woodall <william@osrfoundation.org>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@emersonknapp emersonknapp force-pushed the emersonknapp/nodeinfo_nonunique branch from 86f3cf7 to bba11c4 Compare March 13, 2020 00:59
@hidmic
Copy link
Contributor

hidmic commented Mar 13, 2020

Alright, looking good! Thanks for your contribution @emersonknapp, merging.

@hidmic hidmic merged commit 77271e4 into ros2:master Mar 13, 2020
@emersonknapp emersonknapp deleted the emersonknapp/nodeinfo_nonunique branch March 13, 2020 15:55
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.

3 participants