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

Reduce smoke test flakiness #258

Merged
merged 2 commits into from
Aug 14, 2023
Merged

Reduce smoke test flakiness #258

merged 2 commits into from
Aug 14, 2023

Conversation

achim-k
Copy link
Collaborator

@achim-k achim-k commented Aug 11, 2023

Public-Facing Changes

Reduce smoke test flakiness

Description

Attempt to fix flaky smoke tests:

ROS 1

  • Increased timeouts when waiting for channel to be communicated by the server
    • The ROS 1 server does not listen on graph changes, but instead periodically queries the ROS master for changes regarding available topics or services. The max. period between two consecutive ROS master queries is 5 seconds (default), hence we have to use the same timeout in the test.

ROS 2

  • Use std::atomic for message handler that may be called concurrently
  • Other minor improvements

The ROS1 server does not listen on graph changes, but instead periodically queries the ROS master for changes regarding available topics or services. The max. period between two consecutive ROS master queries is 5 seconds (default), hence we have to use the same timeout in the test.
@achim-k achim-k merged commit cbbdf13 into main Aug 14, 2023
11 checks passed
@achim-k achim-k deleted the achim/improve_test_flakyness branch August 14, 2023 21:07
achim-k added a commit that referenced this pull request Aug 14, 2023
### Public-Facing Changes
Handle client disconnection in message handler thread

### Description
This is a minor improvement that I noticed when working on #258. It may
happen that the close handler is called before the last message of the
client (e.g. `unsubscribe`) is handled which can lead to exceptions
being raised when [accessing the `_clients`
map](https://github.com/foxglove/ros-foxglove-bridge/blob/d78de15b5f1248513dee2ff3566e81e6eac943d0/foxglove_bridge_base/include/foxglove_bridge/websocket_server.hpp#L1252)
(as the client has been removed from that map already). By also handling
close events in the message handler thread, we ensure that the close
handler is always called last.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants