mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 21:21:37 +00:00
test: wait for conditions instead of fixed sleeps
- Channel.GetNumberOfConnectedPeers slept 100 ms and then expected the peer count; on a slow runner the count can change later - poll the count with a deadline instead - remove the 500 ms sleep in Init() of the MultipleDevices sender and receiver: the transfer does not depend on the order of bind and connect Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -563,10 +563,7 @@ auto ReuseReceivedRegionMessage() -> void
|
||||
auto regionA = factory->CreateUnmanagedRegion(regionSize, [&](void*, size_t, void*) { ++releasedA; });
|
||||
auto regionB = factory->CreateUnmanagedRegion(regionSize, [&](void*, size_t, void*) { ++releasedB; });
|
||||
auto waitFor = [](std::atomic<int> const& counter, int value) {
|
||||
for (int i = 0; i < 500 && counter < value; ++i) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
}
|
||||
return counter == value;
|
||||
return test::WaitUntil([&] { return counter == value; });
|
||||
};
|
||||
|
||||
Channel push{"Push", "push", factory};
|
||||
|
||||
Reference in New Issue
Block a user