From 779891210e855fc9a0cdbd3ef72580ffe108817e Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Thu, 8 Sep 2022 11:36:34 +0200 Subject: [PATCH] test/{librbd, rgw}: increase delay between and number of bind attempts Commit aa7885f7cc41 ("test/{librbd, rgw}: retry when bind fail with port 0") reduced the frequency of sporadic unit test failures caused by EADDRINUSE a lot, but not entirely. Currently, it yields a cumulative sleep of ~9 seconds. Let's increase that to 1 minute. Fixes: https://tracker.ceph.com/issues/57116 Signed-off-by: Ilya Dryomov (cherry picked from commit 48016eaa1511ac8a39ed33084e0e230f3b1b5821) --- src/test/librbd/migration/test_mock_HttpClient.cc | 4 ++-- src/test/rgw/test_http_manager.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/librbd/migration/test_mock_HttpClient.cc b/src/test/librbd/migration/test_mock_HttpClient.cc index 630df4be6eef..f3888755c79e 100644 --- a/src/test/librbd/migration/test_mock_HttpClient.cc +++ b/src/test/librbd/migration/test_mock_HttpClient.cc @@ -86,7 +86,7 @@ public: // if we have a racing where another thread manages to bind and listen the // port picked by this acceptor, try again. - static constexpr int MAX_BIND_RETRIES = 42; + static constexpr int MAX_BIND_RETRIES = 60; void create_acceptor(bool reuse) { for (int retries = 0;; retries++) { @@ -105,7 +105,7 @@ public: } } // backoff a little bit - usleep(retries * 10'000); + sleep(1); } m_server_port = m_acceptor->local_endpoint().port(); } diff --git a/src/test/rgw/test_http_manager.cc b/src/test/rgw/test_http_manager.cc index 7d4fce449e28..b58b60dedc81 100644 --- a/src/test/rgw/test_http_manager.cc +++ b/src/test/rgw/test_http_manager.cc @@ -29,7 +29,7 @@ namespace { // if we have a racing where another thread manages to bind and listen the // port picked by this acceptor, try again. - static constexpr int MAX_BIND_RETRIES = 42; + static constexpr int MAX_BIND_RETRIES = 60; tcp::acceptor try_bind(boost::asio::io_context& ioctx) { using tcp = boost::asio::ip::tcp; @@ -50,7 +50,7 @@ namespace { } } // backoff a little bit - usleep(retries * 10'000); + sleep(1); } return acceptor; } -- 2.47.3