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

Add timeout to wait for service response in example #271

Merged
merged 2 commits into from
Sep 23, 2021

Conversation

sloretz
Copy link
Contributor

@sloretz sloretz commented Sep 23, 2021

This might fix the occasional hang seen in https://ci.ros2.org/job/ci_windows/15468/ . If the service response isn't received by the client in 5 seconds then the test will exit.

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
@sloretz sloretz self-assigned this Sep 23, 2021
@sloretz
Copy link
Contributor Author

sloretz commented Sep 23, 2021

CI (build: --packages-up-to launch_testing_ros test: --packages-select launch_testing_ros)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@@ -69,7 +69,7 @@ def set_parameter(self, state=True, timeout=5.0):
request = SetParameters.Request()
request.parameters = parameters
future = client.call_async(request)
rclpy.spin_until_future_complete(self, future)
rclpy.spin_until_future_complete(self, future, timeout_sec=5.0)
Copy link
Contributor

Choose a reason for hiding this comment

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

There's already a timeout being passed to set_parameter, which seems to be totally unused right now. Should we use that instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use timeout parameter in 887ffac

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
@sloretz
Copy link
Contributor Author

sloretz commented Sep 23, 2021

CI re-run

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

This should at least stop the hang, though I suspect we are now going to have a flaky test on our hands. Time will tell.

@sloretz sloretz merged commit 5ca8842 into master Sep 23, 2021
@delete-merged-branch delete-merged-branch bot deleted the timeout_if_future_not_complete branch September 23, 2021 21:46
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.

None yet

3 participants