-
Notifications
You must be signed in to change notification settings - Fork 170
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
Test failures on unexpected output #482
Comments
ros2/rmw_cyclonedds#147 contains the proposal to resolve these test failures. |
Proposed fix in ros2/rmw_cyclonedds#147
This fix narrowly targets that one specific category of output message. |
The fix applies the same patterns already present in various other tests / RMW implementations. |
|
Additional output can happen on stderr, especially when conditions are present that should warrant user concern, or other tools like UBSAN are in use, or simply that verbosity is turned up. Further the proposed fix is fragile since Cyclone logging does not generally conform to an easily detected log pattern. Here are a few suggested fixes:
|
Please read my previous comment why I don't think this is a feasible approach.
That would also leave any other error messages on
I don't think that messages already suppressed using these RMW specific filters can be categorized by a log level. E.g. if just one of them is a warning that would imply the tests have to run with a threshold of error and therefore wouldn't catch if any real warnings would appear in the output. Those kind of manipulations in the test significantly reduce its usefulness. |
I read your previous comment several times, and I think you're wrong: even if the program produces unexpected output (because the global logging verbosity is cranked up or whatnot), THESE TEST CASES SHOULD STILL PASS since the program is succeeding at the task being tested. If there are other error conditions that we want to detect, we should have tests to detect them, not let these test cases turn into catch-all smoke tests. And certainly not have every RMW or plugin package create a whitelist of messages to ignore for If you need a way to filter RCL or RMW output by severity, it exists. Improve that, don't reinvent a new, half-baked and informal standard for classifying log messages. |
Hmm, I think that some insight on the genesis of these tests may help clarify why they are the way they are. Before even The problem with attempting to automate system level QA like this, is that the sheer amount of failure modes makes it unfeasible for a test to cover them all. We cannot replace a seasoned engineer's judgement on seemingly unusual logs, so we don't even try. That's why we aim for So to address your concerns / thoughts:
That'd defeat their purpose. Logging verbosity, implicitly or explicitly, is part of the test configuration.
Yes, that's what these tests are, and no, we can't foresee all error conditions. As you correctly stated:
and we do want to know about it.
ros2/rmw_cyclonedds#147 is not yet another general purpose log severity filtering mechanism. It is a conscious decision we (and hopefully Whether that log should even show or not in normal circumstances is a fair question, and I won't object if you guys want to drop it on your side. But I'd rather not suppress a whole output category to achieve that. |
Your heart is certainly in the right place and I love automating previously manual stuff! The problem is that these build tests are used to verify that development is correct, not just that things are ready at release time. When CI reports a failure (and especially when that failure message is vague), the next step is to rerun the tests locally, with whatever tools are at hand. This includes sanitizers, increased verbosity, debuggers, and ad-hoc debug statements. These debug tools are important to understanding unfamiliar code and, as much as possible, should not cause tests to fail. As for that particular message, I’m not sure that it should be ignored. The computer has two network interfaces and it is an alert to the user that Cyclone is not completely sure of its choice. (Maybe cyclone could be more confident in that choice or maybe it should document better how to configure which one to use; though that’s a different issue). If it’s important to get reproducible results, release testing should be done on an unambiguous network setup or it should inform cyclone which interface to use. I’m sure @thomas-moulard will have feelings about this, though I don’t know what they will be. |
Originally sent via email: I strongly disfavor merging the pull request as-is. These messages are useful and actionable. They indicate an ambiguity in setup and we don’t want to encourage ignoring such messages with a whitelist. Either they are useful and and should stay and not be filtered out by any testing or interaction tools, or they are not useful and they should not be emitted by default. Proposals, any of which I think are reasonable:
Note that 1 and 2 would also fix the spurious test failure when rerunning locally with increased verbosity or sanitizers like UBSAN. |
I see two actionable outcomes of this discussion.
The reasons you've outlined for not ignoring that particular log are absolutely reasonable (and something that probably wouldn't have been brought up if these tests were as permissive as you propose). So I can agree on 4. i.e. to
That is absolutely true as well, but the fact that these tests are impractical for development does not render them incorrect. To serve that specific purpose, we could have some form of build time or run time configuration to relax the expectations in these tests, and perhaps that of some CI jobs, allowing one set of tests to serve both development and release QA needs. Something like 3. i.e. to |
I think it's unlikely that eclipse-cyclonedds/cyclonedds#485 will land in the very short term. This is all I could find on restricting the interface in a generic way: https://answers.ros.org/question/299940/explicitly-constraining-which-network-interfaces-are-used-in-ros2/ In the near term, the best solution seems to be restricting tests to checking stdout (this would also resolve #484 since the current tests seem like they would pass if the current output accidentally came out on stderr). If it's important to check stderr as well, I'm sure there are good solutions like running these on a well-defined environment and flagging unexpected output for manual review (similar to pytest warnings capture) |
Fixes #480 The actual tests are the same, except with the use of launch_testing we ensure the CLI daemon is restarted between tests. This follows a similar pattern as the other ros2cli tests. I've left a TODO to test with all RMW implementations. I did not enable this now since I do not expect the tests to pass with all RMW implementations. See #482 Signed-off-by: Jacob Perron <jacob@openrobotics.org>
That is exactly what we are trying to achieve - as specific as possible. And as you said before yourself "Cyclone logging does not generally conform to an easily detected log pattern". So the only entity know what output is "irrelevant" is CycloneDDS. Any other approach (by stream, by log level, whatever else) will unavoidably lead to other output also being ignore which is undesired. But this has been described and argued for above already.
It has been mentioned multiple times already why it is considered not appropriate. Please see the previous comments from me as well as @hidmic.
These tests are run by developer locally, via Jenkins, in GitHub actions, and in environment I don't even know about. They need to pass by default with no need for custom configurations. Therefore I don't consider the requirement for a custom environment a viable option. So from my point of view there is still not a single alternative proposal on the table which doesn't impair the scope of the existing tests. |
Closing since ros2/rmw_cyclonedds#147 was merged. |
Fixes #480 The actual tests are the same, except with the use of launch_testing we ensure the CLI daemon is restarted between tests. This follows a similar pattern as the other ros2cli tests. I've left a TODO to test with all RMW implementations. I did not enable this now since I do not expect the tests to pass with all RMW implementations. See #482 Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Fixes #480 The actual tests are the same, except with the use of launch_testing we ensure the CLI daemon is restarted between tests. This follows a similar pattern as the other ros2cli tests. I've left a TODO to test with all RMW implementations. I did not enable this now since I do not expect the tests to pass with all RMW implementations. See #482 Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Bug report
As originally mentioned in ros2/rmw_cyclonedds#147 by @hidmic:
test failures as seen in https://ci.ros2.org/view/nightly/job/nightly_osx_debug/1588/testReport/.
Although not seen in the test failure messages, the failures are caused by unexpected output from Cyclone DDS. In particular, "
using network interface en0 (udp/192.168.1.120) selected arbitrarily from: en0, en1
". This is followed by the output the program expects.The text was updated successfully, but these errors were encountered: