Open sloretz opened 3 years ago
I think this is the cause of the test failures in CI for https://github.com/ros/joint_state_publisher/pull/67
@sloretz I suspect the test is racing with asyncio.subprocess
IO (at best, assuming foobar
actually made it back through pipes). I'll fiddle with this a bit to confirm.
Alright, I can only reproduce it by putting the machine under stress
. It looks as if launch_testing
is shutting down the fixture (by firing SIGINTs) before echo
is even scheduled. There's no pre-shutdown test, so this MRE is inherently racy.
@sloretz consider waiting for and asserting the exit code in a pre-shutdown test.
@clalancette @sloretz let me know what you want to do about this ticket. Perhaps some documentation somewhere?
@sloretz consider waiting for and asserting the exit code in a pre-shutdown test. @clalancette @sloretz let me know what you want to do about this ticket. Perhaps some documentation somewhere?
I would expect any post-shutdown information to be ready to retrieve in a @post_shutdown_test()
. Can launch_test wait until the exit code is ready before calling the post-shutdown test?
I would expect any post-shutdown information to be ready to retrieve in a @post_shutdown_test().
It is available -- not the one you expect though, because of early signaling.
Can
launch_test
wait until the exit code is ready before calling the post-shutdown test?
We can force launch_testing
to wait for the launch service to go idle. #528 supports that. We could do something similar here.
For me, there are two sides to this.
One is the "legacy" launch_testing
framework. While I think we can make improvements there, I think we should probably keep changes minimal. That said, because we still have to support launch_testing
in Foxy until 2023, we should document how to do some of this stuff more nicely.
The other side is the "new" pytest
-based testing framework being done in #528. There I would want to make sure that this is much more intuitive for the end-user (which it sounds like it is).
I also came across this issue. Is there a workaround for Foxy?
Bug report
Required Info:
Steps to reproduce issue
Save the following as
mre.py
Use
launch_test
command to run itExpected behavior
The test would always succeeds
Actual behavior
The test fails most, but not all of the time (fails about 90% of the time on my machine)
Additional information
When it succeeds the output is:
When it fails the output is:
Is the
@post_shutdown_test()
letting the test run before the process shuts down?