Do not use ros2cli daemon in generate_policy tests.#212
Do not use ros2cli daemon in generate_policy tests.#212
Conversation
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
|
Yeah it's a trade-off, I considered removing it when it caused problems a few PRs ago but didn't do it for 2 reasons:
It's not clear to me that this change is a clear win overall. Maybe it's worth having some tests using it and some tests not using it to have coverage for both scenarios |
Codecov Report
@@ Coverage Diff @@
## master #212 +/- ##
=======================================
Coverage 77.95% 77.95%
=======================================
Files 16 16
Lines 576 576
Branches 52 52
=======================================
Hits 449 449
Misses 107 107
Partials 20 20
Continue to review full report at Codecov.
|
dirk-thomas
left a comment
There was a problem hiding this comment.
LGTM.
The alternative would be to explicitly stop an already running daemon at the beginning of the test (which we do in some other tests).
True, but the daemon doesn't really make things any better in this case i.e. where each test sets up a ROS graph of its own.
True, and I agree we can change this test to cover both cases. But I do see this patch as an improvement, as it avoids cross-talk between tests and ensures these run in a consistent manner.
Right, plus an explicit wait for that daemon to discover nodes instantiated within tests. |
For sure.
I think this is what we should do here, otherwise we remove test coverage for things we know broke the CLI and trading it for potential CI flakiness reduction. |
|
Fair enough. I'll mix and match #168 and this PR to test all RMW implementations, with and without a daemon. |
|
Alright, this has been superseded by #214. Let's continue the discussion there. |
Precisely what the title says. As it stands,
test_generate_policy.pymay fail because of discovery latencies, CLI daemon state spanning multiple tests and even using a non-matching RMW implementation. This circumvents that problem by simply not using it and providing 1 second for discovery to take place (which should be enough for Fast-RTPS at least).