diff --git a/gerrit_util.py b/gerrit_util.py index 2ccc68556..8312bbac7 100644 --- a/gerrit_util.py +++ b/gerrit_util.py @@ -44,10 +44,11 @@ else: from io import StringIO LOGGER = logging.getLogger() -# With a starting sleep time of 10.0 seconds, x <= [1.8-2.2]x backoff, and five -# total tries, the sleep time between the first and last tries will be ~7 min. -TRY_LIMIT = 5 -SLEEP_TIME = 10.0 +# With a starting sleep time of 12.0 seconds, x <= [1.8-2.2]x backoff, and six +# total tries, the sleep time between the first and last tries will be ~6 min +# (excluding time for each try). +TRY_LIMIT = 6 +SLEEP_TIME = 12.0 MAX_BACKOFF = 2.2 MIN_BACKOFF = 1.8 diff --git a/tests/gerrit_util_test.py b/tests/gerrit_util_test.py index 76ab745a6..4eda84aa8 100755 --- a/tests/gerrit_util_test.py +++ b/tests/gerrit_util_test.py @@ -390,7 +390,7 @@ class GerritUtilTest(unittest.TestCase): self.assertEqual('content✔', gerrit_util.ReadHttpResponse(conn).getvalue()) self.assertEqual(2, len(conn.request.mock_calls)) - gerrit_util.time_sleep.assert_called_once_with(10.0) + gerrit_util.time_sleep.assert_called_once_with(12.0) def testReadHttpResponse_TimeoutAndSuccess(self): conn = mock.Mock(req_params={'uri': 'uri', 'method': 'method'}) @@ -401,7 +401,7 @@ class GerritUtilTest(unittest.TestCase): self.assertEqual('content✔', gerrit_util.ReadHttpResponse(conn).getvalue()) self.assertEqual(2, len(conn.request.mock_calls)) - gerrit_util.time_sleep.assert_called_once_with(10.0) + gerrit_util.time_sleep.assert_called_once_with(12.0) def testReadHttpResponse_Expected404(self): conn = mock.Mock()