From b48fb11d8a7846cfc83f24f1782b43d6ee37f0ab Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Mon, 20 May 2024 21:42:33 +0300 Subject: [PATCH] Typo --- src/charm.py | 2 +- tests/unit/test_charm.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/charm.py b/src/charm.py index ab887a52ee..99592539af 100755 --- a/src/charm.py +++ b/src/charm.py @@ -1468,7 +1468,7 @@ def _restart(self, event: RunWithLock) -> None: return try: - for attempt in Retrying(wait=wait_fixed(3), stop_after_delay=stop_after_delay(300)): + for attempt in Retrying(wait=wait_fixed(3), stop=stop_after_delay(300)): with attempt: if not self._can_connect_to_postgresql: assert False diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py index 415048e6ad..96e85579e6 100644 --- a/tests/unit/test_charm.py +++ b/tests/unit/test_charm.py @@ -1135,6 +1135,7 @@ def test_restart(harness): with ( patch("charm.Patroni.restart_postgresql") as _restart_postgresql, patch("charm.Patroni.are_all_members_ready") as _are_all_members_ready, + patch("charm.PostgresqlOperatorCharm._can_connect_to_postgresql", return_value=True) ): _are_all_members_ready.side_effect = [False, True, True]