Skip to content
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

Prevent subscriber tests from hanging forever if no work #401

Closed
wants to merge 1 commit into from

Conversation

rotu
Copy link
Contributor

@rotu rotu commented Mar 5, 2020

Signed-off-by: Dan Rose [email protected]

@@ -62,7 +62,7 @@ def listener(message_name, namespace):
spin_count = 1
print('subscriber: beginning loop')
while (rclpy.ok() and len(received_messages) != len(expected_msgs)):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition will still not be met, regardless of spin_once timeout, and this will still be waiting forever (or to the test to timeout). So, changing spin_once behavior from blocking to anything else just makes the loop more busy.

I think the original test case was ok, we can change the timeout of the test to a smaller value to avoid CI taking much longer when some of these tests fail.

@claireyywang
Copy link

@rotu friendly ping

@rotu
Copy link
Contributor Author

rotu commented Mar 20, 2020

Thanks! Yeah, I’m closing this due to user error. I had inferred from the test output that the listener having to be terminated was the problem. Opened #404.

@rotu rotu closed this Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants