spetz commented on code in PR #3691:
URL: https://github.com/apache/iggy/pull/3691#discussion_r3610800899
##########
foreign/cpp/tests/client/low_level_e2e.cpp:
##########
@@ -32,6 +35,29 @@
class LowLevelE2E_Client : public E2ETestFixture {};
+namespace {
+
+constexpr auto session_removal_timeout = std::chrono::seconds(5);
+constexpr auto session_removal_poll_interval = std::chrono::milliseconds(10);
+
+bool wait_for_client_removal(iggy::ffi::Client *observer, std::uint32_t
client_id) {
+ const auto deadline = std::chrono::steady_clock::now() +
session_removal_timeout;
+ do {
+ const auto clients = observer->get_clients();
+ const auto removed = std::none_of(clients.begin(), clients.end(),
+ [client_id](const auto &client) {
return client.client_id == client_id; });
+ if (removed) {
+ return true;
+ }
+
+ std::this_thread::sleep_for(session_removal_poll_interval);
+ } while (std::chrono::steady_clock::now() < deadline);
+
+ return false;
Review Comment:
Fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]