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:
Claude
2026-11-03 14:10:18 +00:00
committed by Dennis Klein
parent d67a6c0745
commit d4a85086aa
4 changed files with 5 additions and 25 deletions

View File

@@ -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};