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

Fix TriggeredPublisher test #2354

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions test/integration/triggered_publisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,16 @@ TEST_F(TriggeredPublisherTest,

std::string service = "/srv-test";
node.Advertise(service, srvEchoCb);
{
// This block of code is here because service requests from a previous test
// might interfere with this test. We sleep a small amount time and reset
// `recvCount` to 0. This ensures that the service requets from the previous
// test are discarded properly.
// TODO(azeey) Remove once
// https://github.com/gazebosim/gz-transport/issues/491 is resolved.
GZ_SLEEP_MS(2000);
recvCount = 0;
}

const std::size_t pubCount{10};
for (std::size_t i = 0; i < pubCount; ++i)
Expand Down
Loading