diff --git a/edb/server/connpool/pool.py b/edb/server/connpool/pool.py index 8f424cae3dd2..d767bc231f44 100644 --- a/edb/server/connpool/pool.py +++ b/edb/server/connpool/pool.py @@ -539,7 +539,8 @@ async def _connect( # 3D000 - INVALID CATALOG NAME, database does not exist # Skip retry and propagate the error immediately if block.connect_failures_num <= config.CONNECT_FAILURE_RETRIES: - block.connect_failures_num = config.CONNECT_FAILURE_RETRIES + 1 + block.connect_failures_num = ( + config.CONNECT_FAILURE_RETRIES + 1) if block.connect_failures_num > config.CONNECT_FAILURE_RETRIES: # Abort all waiters on this block and propagate the error, as diff --git a/tests/test_server_pool.py b/tests/test_server_pool.py index d16facf8de27..6148615760fa 100644 --- a/tests/test_server_pool.py +++ b/tests/test_server_pool.py @@ -1496,7 +1496,8 @@ async def main(): asyncio.run(main()) - @unittest.mock.patch('edb.server.connpool.config.CONNECT_FAILURE_RETRIES', 2) + @unittest.mock.patch('edb.server.connpool.config.CONNECT_FAILURE_RETRIES', + 2) def test_connpool_connect_error(self): from edb.server.pgcon import errors @@ -1511,7 +1512,8 @@ class ConnectError(Exception): self._test_connpool_connect_error(ConnectError, 3) - @unittest.mock.patch('edb.server.connpool.config.CONNECT_FAILURE_RETRIES', 0) + @unittest.mock.patch('edb.server.connpool.config.CONNECT_FAILURE_RETRIES', + 0) def test_connpool_connect_error_zero_retry(self): class ConnectError(Exception): pass @@ -1521,7 +1523,8 @@ class ConnectError(Exception): @unittest.mock.patch('edb.server.connpool.pool.logger', new_callable=MockLogger) @unittest.mock.patch('edb.server.connpool.config.MIN_LOG_TIME_THRESHOLD', 0) - @unittest.mock.patch('edb.server.connpool.config.CONNECT_FAILURE_RETRIES', 5) + @unittest.mock.patch('edb.server.connpool.config.CONNECT_FAILURE_RETRIES', + 5) def test_connpool_steal_connect_error(self, logger: MockLogger): count = 0 connect = self.make_fake_connect()