-
Notifications
You must be signed in to change notification settings - Fork 155
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
finish doneCb before waitForResult returns #156
Conversation
as suggested by rhaschke in ros#156 (comment)
@mjcarroll Please review. |
@jschleicher Looks good, but please retarget to |
by introducing a short sleep (essentially inducing a scheduler context switch) in the done-callback
as suggested by rhaschke in ros#156 (comment)
17b64d8
to
cf20253
Compare
@mjcarroll Thank you! I've rebased onto noetic-devel. |
as in easy_tests
cf20253
to
5b07440
Compare
since the simple action server otherwise cancels parallel requests from the two python and cpp clients
bc7c000
to
347fb81
Compare
to fix the corresponding CMake warning
347fb81
to
56d1afc
Compare
This reverts commit 75fec60.
@ros-pull-request-builder retest this please |
This reverts commit 94367db.
bd4a33f
to
cd2c25e
Compare
@mjcarroll The tests are still unstable, which seems to be an occurrence of #119 (comment). Adding a delay time after |
@@ -104,18 +98,21 @@ TEST(SimpleClient, easy_callback) | |||
bool started = client.waitForServer(ros::Duration(10.0)); | |||
ASSERT_TRUE(started); | |||
|
|||
// sleep a bit to make sure that all topics are properly connected to the server. | |||
ros::Duration(0.01).sleep(); |
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.
i believe this should be done by waitForServer.
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.
Yep, it should. But actually it isn't, see my comment above: #156 (comment)
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.
i understand this is just a work-around to pass the test, but even with this duration SimpleClientFixture fails with server state is still ACTIVE (expected to be SUCCESS). so I expect this additional duration is not needed.
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.
It's the unrelated test file exercise_simple_client.cpp
that fails - adding another sleep over there would help.
[actionlib.rosunit-test_cpp_simple_client/just_succeed][FAILURE]
/tmp/ws/src/actionlib/actionlib/test/exercise_simple_client.cpp:72
void easyOldDoneCallback(bool * called, const TerminalState & terminal_state, | ||
const TestResultConstPtr &) | ||
{ | ||
ros::Duration(0.1).sleep(); |
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.
what is this duration for?
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.
It's a callback, that takes some time and gives execution back to the main thread in the mean time. Without the fix, this test case easy_callback
fails.
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.
See also reproduction step 2. in #155.
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.
LGTM
@mjcarroll: @jschleicher continuously provided feedback on this for over four months now, It would be great to see this merged and released in noetic (and best-case also a backport to melodic, but at this point I would be happy to see this merged in any branch)! |
@v4hn Yes, I appreciate the iteration from @jschleicher. At this point, I think it's acceptable to land on |
@ros-pull-request-builder retest this please |
@jschleicher Do you want to do this in a follow up PR? |
* call doneCb before setting client state (Fixes ros#155) * add testcase to fail without the fix * also test getState() in the callback * wait until the server is ready * increase time limit for unrelated test * separate exercise_simple_client into cpp and python * increase debug output * wait for longer for server * bump CMake minimum version to use new behavior of CMP0048 * test build with more debug output * Revert "wait for longer for server" * Revert "test build with more debug output"
actionlib was fixed via ros/actionlib#156
actionlib was fixed via ros/actionlib#156
actionlib was fixed via ros/actionlib#156
* cleanup after actionlib fix actionlib was fixed via ros/actionlib#156 * Reset status variables before calling sendGoal() This fixes a race condition, where the execution status is set to RUNNING after the doneCallback has been called, e.g. because the controller immediately reports success.
Fixes #155
Isindigo-devel
the correct branch? Or should this be targeted to noetic to avoid breaking old use-cases?