-
Notifications
You must be signed in to change notification settings - Fork 226
Include localhost in ros2 doctor hello connectivity checks #1269
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
base: rolling
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,12 +42,14 @@ def generate_test_description(): | |
| ]) | ||
|
|
||
|
|
||
| def _generate_expected_summary_table(): | ||
| def _generate_expected_summary_table(hostname): | ||
| """Generate expected summary table for one emit period on a single host.""" | ||
| expected_summary = SummaryTable() | ||
| # 1 pub/send per default emit period | ||
| # 1 pub/send and matching local sub/receive per default emit period | ||
| expected_summary.increment_pub() | ||
| expected_summary.increment_sub(hostname) | ||
| expected_summary.increment_send() | ||
| expected_summary.increment_receive(hostname) | ||
| return expected_summary | ||
|
|
||
|
|
||
|
|
@@ -61,11 +63,12 @@ def test_hello_single_host(self): | |
| args.print_period = 1.0 | ||
| args.ttl = None | ||
| args.once = True | ||
| with mock.patch('socket.gethostname', return_value='!nv@lid-n*de-n4me'): | ||
| hostname = '!nv@lid-n*de-n4me' | ||
| with mock.patch('socket.gethostname', return_value=hostname): | ||
| summary = SummaryTable() | ||
| hello_verb = HelloVerb() | ||
| hello_verb.main(args=args, summary_table=summary) | ||
| expected_summary = _generate_expected_summary_table() | ||
| expected_summary = _generate_expected_summary_table(hostname) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with PR, the following assertion is only correct if two independent round-trips both complete within roughly that one 0.1-second window, i suggest that is tough and this is gonna be flaky test.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. I removed the 0.1-second timing assumption. In --once mode the command now waits, with a bounded 5-second timeout, for both the local topic subscription and multicast receive before producing the summary. |
||
| self.assertEqual(summary._pub, expected_summary._pub) | ||
| self.assertEqual(summary._sub, expected_summary._sub) | ||
| self.assertEqual(summary._send, expected_summary._send) | ||
|
|
||
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.
how does it guarantee that is come from the same instance shutdown though? guessing this is flaky and can leak into other instances on the same host?
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.
Good point. The shared UDP wake-up could be delivered to another receiver bound to the same port. I replaced it with a per-instance socket.socketpair() used only to wake that receiver thread, so shutdown signaling can no longer leak into another ros2 doctor hello instance.