From: Ilya Dryomov Date: Thu, 8 Sep 2022 09:36:34 +0000 (+0200) Subject: test/{librbd, rgw}: increase delay between and number of bind attempts X-Git-Tag: v16.2.11~332^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a7fec0240d221e5d868a51b860f285587656eb49;p=ceph.git 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) --- 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 6aff557bd02e..398839484895 100644 --- a/src/test/rgw/test_http_manager.cc +++ b/src/test/rgw/test_http_manager.cc @@ -27,7 +27,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; @@ -48,7 +48,7 @@ namespace { } } // backoff a little bit - usleep(retries * 10'000); + sleep(1); } return acceptor; }