diff --git a/src/charm.py b/src/charm.py index f7f9675d59..040b3a9b49 100755 --- a/src/charm.py +++ b/src/charm.py @@ -353,7 +353,7 @@ def primary_endpoint(self) -> Optional[str]: logger.debug("primary endpoint early exit: Peer relation not joined yet.") return None try: - for attempt in Retrying(stop=stop_after_delay(5), wait=wait_fixed(3)): + for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(3)): with attempt: primary = self._patroni.get_primary() if primary is None and (standby_leader := self._patroni.get_standby_leader()): diff --git a/src/cluster.py b/src/cluster.py index 14651400e9..29a42e87b5 100644 --- a/src/cluster.py +++ b/src/cluster.py @@ -362,7 +362,7 @@ def are_all_members_ready(self) -> bool: def get_patroni_health(self) -> Dict[str, str]: """Gets, retires and parses the Patroni health endpoint.""" - for attempt in Retrying(stop=stop_after_delay(60), wait=wait_fixed(7)): + for attempt in Retrying(stop=stop_after_delay(90), wait=wait_fixed(3)): with attempt: r = requests.get( f"{self._patroni_url}/health", diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py index e69dad14fd..30e57945a2 100644 --- a/tests/unit/test_charm.py +++ b/tests/unit/test_charm.py @@ -181,7 +181,7 @@ def test_primary_endpoint(harness): assert harness.charm.primary_endpoint == "1.1.1.1" # Check needed to ensure a fast charm deployment. - _stop_after_delay.assert_called_once_with(5) + _stop_after_delay.assert_called_once_with(60) _wait_fixed.assert_called_once_with(3) _patroni.return_value.get_member_ip.assert_called_once_with(sentinel.primary) diff --git a/tests/unit/test_cluster.py b/tests/unit/test_cluster.py index dbe2cb3901..e23f9e0da5 100644 --- a/tests/unit/test_cluster.py +++ b/tests/unit/test_cluster.py @@ -140,8 +140,8 @@ def test_get_patroni_health(peers_ips, patroni): health = patroni.get_patroni_health() # Check needed to ensure a fast charm deployment. - _stop_after_delay.assert_called_once_with(60) - _wait_fixed.assert_called_once_with(7) + _stop_after_delay.assert_called_once_with(90) + _wait_fixed.assert_called_once_with(3) tc.assertEqual(health, {"state": "running"})