]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test/{librbd, rgw}: increase delay between and number of bind attempts
authorIlya Dryomov <idryomov@gmail.com>
Thu, 8 Sep 2022 09:36:34 +0000 (11:36 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 8 Sep 2022 09:46:58 +0000 (11:46 +0200)
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 <idryomov@gmail.com>
src/test/librbd/migration/test_mock_HttpClient.cc
src/test/rgw/test_http_manager.cc

index 630df4be6eef2b7f81ad9896502e50681e32c711..f3888755c79e584b83574479e8ebbfbf634a24ec 100644 (file)
@@ -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();
   }
index 7d4fce449e28cb23bd2e0125d61f034dc1187730..b58b60dedc81a40ee1c5d39b35e0a74a1e886d4a 100644 (file)
@@ -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;
   }