From 4bf37c054f0384525b69415c4e779777bf867e75 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Tue, 10 Jun 2025 02:10:13 +0300 Subject: [PATCH 01/13] Handle PostgreSQLListUsersError --- src/charm.py | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/charm.py b/src/charm.py index 62f1a23fbf..1bcca26625 100755 --- a/src/charm.py +++ b/src/charm.py @@ -2488,22 +2488,30 @@ def relations_user_databases_map(self) -> dict: if not self.is_cluster_initialised or not self._patroni.member_started: return {USER: "all", REPLICATION_USER: "all", REWIND_USER: "all"} user_database_map = {} - for user in self.postgresql.list_users_from_relation( - current_host=self.is_connectivity_enabled - ): - user_database_map[user] = ",".join( - self.postgresql.list_accessible_databases_for_user( - user, current_host=self.is_connectivity_enabled + try: + for user in self.postgresql.list_users_from_relation( + current_host=self.is_connectivity_enabled + ): + user_database_map[user] = ",".join( + self.postgresql.list_accessible_databases_for_user( + user, current_host=self.is_connectivity_enabled + ) ) - ) - # Add "landscape" superuser by default to the list when the "db-admin" relation is present. - if any(True for relation in self.client_relations if relation.name == "db-admin"): - user_database_map["landscape"] = "all" - if self.postgresql.list_access_groups(current_host=self.is_connectivity_enabled) != set( - ACCESS_GROUPS - ): - user_database_map.update({USER: "all", REPLICATION_USER: "all", REWIND_USER: "all"}) - return user_database_map + # Add "landscape" superuser by default to the list when the "db-admin" relation is present. + if any(True for relation in self.client_relations if relation.name == "db-admin"): + user_database_map["landscape"] = "all" + if self.postgresql.list_access_groups( + current_host=self.is_connectivity_enabled + ) != set(ACCESS_GROUPS): + user_database_map.update({ + USER: "all", + REPLICATION_USER: "all", + REWIND_USER: "all", + }) + return user_database_map + except PostgreSQLListUsersError: + logger.debug("relations_user_databases_map: Unable to get users") + return {USER: "all", REPLICATION_USER: "all", REWIND_USER: "all"} def override_patroni_restart_condition( self, new_condition: str, repeat_cause: str | None From 0f7eaa6cfab74816b3677d0b3061dcdfa6b60bba Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Tue, 10 Jun 2025 13:07:53 +0300 Subject: [PATCH 02/13] Try to trigger the pg_hba update on db requested --- src/relations/postgresql_provider.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/relations/postgresql_provider.py b/src/relations/postgresql_provider.py index d07ed699ac..58b18416c0 100644 --- a/src/relations/postgresql_provider.py +++ b/src/relations/postgresql_provider.py @@ -5,6 +5,7 @@ import logging import typing +from datetime import datetime from charms.data_platform_libs.v0.data_interfaces import ( DatabaseProvides, @@ -152,6 +153,7 @@ def _on_database_requested(self, event: DatabaseRequestedEvent) -> None: else f"Failed to initialize relation {self.relation_name}" ) ) + self.charm.unit_peer_data.update({"pg_hba_needs_update_timestamp": str(datetime.now())}) def _on_relation_changed(self, event: RelationChangedEvent) -> None: # Check for some conditions before trying to access the PostgreSQL instance. From 9ca41e7ec23a2b93e2cd9fddd226fb5397870298 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Tue, 10 Jun 2025 15:42:05 +0300 Subject: [PATCH 03/13] Try to hold db requested until pg_hba is up to date --- lib/charms/postgresql_k8s/v1/postgresql.py | 18 ++++++++++++++++++ src/relations/postgresql_provider.py | 13 ++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/charms/postgresql_k8s/v1/postgresql.py b/lib/charms/postgresql_k8s/v1/postgresql.py index 03449fa171..09570058a3 100644 --- a/lib/charms/postgresql_k8s/v1/postgresql.py +++ b/lib/charms/postgresql_k8s/v1/postgresql.py @@ -1246,3 +1246,21 @@ def validate_group_map(self, group_map: Optional[str]) -> bool: return False return True + + def is_user_in_hba(self, username: str) -> bool: + """Check if user was added in pg_hba.""" + connection = None + try: + with self._connect_to_database() as connection, connection.cursor() as cursor: + cursor.execute( + SQL( + "SELECT COUNT(*) FROM pg_hba_file_rules WHERE {} = ANY(user_name);" + ).format(Literal(username)) + ) + return cursor.fetchone()[0] > 0 + except psycopg2.Error as e: + logger.debug(f"Failed to check pg_hba: {e}") + return False + finally: + if connection: + connection.close() diff --git a/src/relations/postgresql_provider.py b/src/relations/postgresql_provider.py index 58b18416c0..e927b96b92 100644 --- a/src/relations/postgresql_provider.py +++ b/src/relations/postgresql_provider.py @@ -24,6 +24,7 @@ from ops.charm import RelationBrokenEvent, RelationChangedEvent from ops.framework import Object from ops.model import ActiveStatus, BlockedStatus, Relation +from tenacity import RetryError, Retrying, stop_after_attempt, wait_fixed from constants import ( ALL_CLIENT_RELATIONS, @@ -153,7 +154,17 @@ def _on_database_requested(self, event: DatabaseRequestedEvent) -> None: else f"Failed to initialize relation {self.relation_name}" ) ) - self.charm.unit_peer_data.update({"pg_hba_needs_update_timestamp": str(datetime.now())}) + + # Try to wait for pg_hba trigger + try: + for attempt in Retrying(stop=stop_after_attempt(3), wait=wait_fixed(1)): + with attempt: + self.charm.postgresql.is_user_in_hba(user) + self.charm.unit_peer_data.update({ + "pg_hba_needs_update_timestamp": str(datetime.now()) + }) + except RetryError: + logger.warning("database requested: Unable to check pg_hba rule update") def _on_relation_changed(self, event: RelationChangedEvent) -> None: # Check for some conditions before trying to access the PostgreSQL instance. From e1b0c1c7f1b7f82127249a4bbef952fe00681a58 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Tue, 10 Jun 2025 17:32:06 +0300 Subject: [PATCH 04/13] Increase timeouts --- tests/integration/ha_tests/test_async_replication.py | 10 ++++++++-- tests/integration/helpers.py | 11 +++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tests/integration/ha_tests/test_async_replication.py b/tests/integration/ha_tests/test_async_replication.py index 1e3fdd3c1a..bc6d2073eb 100644 --- a/tests/integration/ha_tests/test_async_replication.py +++ b/tests/integration/ha_tests/test_async_replication.py @@ -531,7 +531,9 @@ async def test_scaling( async with ops_test.fast_forward(FAST_INTERVAL), fast_forward(second_model, FAST_INTERVAL): logger.info("scaling out the first cluster") - first_cluster_original_size = len(first_model.applications[DATABASE_APP_NAME].units) + first_cluster_original_size = len( + first_model.applications[DATABASE_APP_NAME].units, timeout=2500 + ) await scale_application(ops_test, DATABASE_APP_NAME, first_cluster_original_size + 1) logger.info("checking whether writes are increasing") @@ -540,7 +542,11 @@ async def test_scaling( logger.info("scaling out the second cluster") second_cluster_original_size = len(second_model.applications[DATABASE_APP_NAME].units) await scale_application( - ops_test, DATABASE_APP_NAME, second_cluster_original_size + 1, model=second_model + ops_test, + DATABASE_APP_NAME, + second_cluster_original_size + 1, + model=second_model, + timeout=2500, ) logger.info("checking whether writes are increasing") diff --git a/tests/integration/helpers.py b/tests/integration/helpers.py index 7b1a9485ea..1514cee62f 100644 --- a/tests/integration/helpers.py +++ b/tests/integration/helpers.py @@ -1018,7 +1018,12 @@ async def run_command_on_unit(ops_test: OpsTest, unit_name: str, command: str) - async def scale_application( - ops_test: OpsTest, application_name: str, count: int, model: Model = None + ops_test: OpsTest, + application_name: str, + count: int, + model: Model = None, + timeout=2000, + idle_period: int = 30, ) -> None: """Scale a given application to a specific unit count. @@ -1027,6 +1032,8 @@ async def scale_application( application_name: The name of the application count: The desired number of units to scale to model: The model to scale the application in + timeout: timeout period + idle_period: idle period """ if model is None: model = ops_test.model @@ -1040,7 +1047,7 @@ async def scale_application( apps=[application_name], status="active", timeout=2000, - idle_period=30, + idle_period=idle_period, wait_for_exact_units=count, ) From 07ff24ac1c917d5b04ed6e3b98dfeda217b9ca03 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Tue, 10 Jun 2025 20:21:31 +0300 Subject: [PATCH 05/13] Scale in parallel --- .../ha_tests/test_async_replication.py | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/tests/integration/ha_tests/test_async_replication.py b/tests/integration/ha_tests/test_async_replication.py index bc6d2073eb..792a2813b3 100644 --- a/tests/integration/ha_tests/test_async_replication.py +++ b/tests/integration/ha_tests/test_async_replication.py @@ -530,37 +530,31 @@ async def test_scaling( await are_writes_increasing(ops_test) async with ops_test.fast_forward(FAST_INTERVAL), fast_forward(second_model, FAST_INTERVAL): - logger.info("scaling out the first cluster") + logger.info("scaling out the clusters") first_cluster_original_size = len( first_model.applications[DATABASE_APP_NAME].units, timeout=2500 ) - await scale_application(ops_test, DATABASE_APP_NAME, first_cluster_original_size + 1) - - logger.info("checking whether writes are increasing") - await are_writes_increasing(ops_test, extra_model=second_model) - - logger.info("scaling out the second cluster") second_cluster_original_size = len(second_model.applications[DATABASE_APP_NAME].units) - await scale_application( - ops_test, - DATABASE_APP_NAME, - second_cluster_original_size + 1, - model=second_model, - timeout=2500, + await gather( + scale_application(ops_test, DATABASE_APP_NAME, first_cluster_original_size + 1), + scale_application( + ops_test, + DATABASE_APP_NAME, + second_cluster_original_size + 1, + model=second_model, + timeout=2500, + ), ) logger.info("checking whether writes are increasing") await are_writes_increasing(ops_test, extra_model=second_model) - logger.info("scaling in the first cluster") - await scale_application(ops_test, DATABASE_APP_NAME, first_cluster_original_size) - - logger.info("checking whether writes are increasing") - await are_writes_increasing(ops_test, extra_model=second_model) - - logger.info("scaling in the second cluster") - await scale_application( - ops_test, DATABASE_APP_NAME, second_cluster_original_size, model=second_model + logger.info("scaling in the clusters") + await gather( + scale_application(ops_test, DATABASE_APP_NAME, first_cluster_original_size), + scale_application( + ops_test, DATABASE_APP_NAME, second_cluster_original_size, model=second_model + ), ) logger.info("checking whether writes are increasing") From 1b556d576f75a295a4228e4013e74b71eea1be79 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Tue, 10 Jun 2025 21:54:10 +0300 Subject: [PATCH 06/13] Fix param passing --- tests/integration/ha_tests/test_async_replication.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/ha_tests/test_async_replication.py b/tests/integration/ha_tests/test_async_replication.py index 792a2813b3..f92f42e4e2 100644 --- a/tests/integration/ha_tests/test_async_replication.py +++ b/tests/integration/ha_tests/test_async_replication.py @@ -531,12 +531,12 @@ async def test_scaling( async with ops_test.fast_forward(FAST_INTERVAL), fast_forward(second_model, FAST_INTERVAL): logger.info("scaling out the clusters") - first_cluster_original_size = len( - first_model.applications[DATABASE_APP_NAME].units, timeout=2500 - ) + first_cluster_original_size = len(first_model.applications[DATABASE_APP_NAME].units) second_cluster_original_size = len(second_model.applications[DATABASE_APP_NAME].units) await gather( - scale_application(ops_test, DATABASE_APP_NAME, first_cluster_original_size + 1), + scale_application( + ops_test, DATABASE_APP_NAME, first_cluster_original_size + 1, timeout=2500 + ), scale_application( ops_test, DATABASE_APP_NAME, From aeb823fca5d1d499db82158c25f014f3b27b7c2d Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Tue, 10 Jun 2025 23:38:00 +0300 Subject: [PATCH 07/13] Increase timeout --- tests/integration/ha_tests/test_async_replication.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/ha_tests/test_async_replication.py b/tests/integration/ha_tests/test_async_replication.py index f92f42e4e2..4c5b63a7ed 100644 --- a/tests/integration/ha_tests/test_async_replication.py +++ b/tests/integration/ha_tests/test_async_replication.py @@ -535,14 +535,14 @@ async def test_scaling( second_cluster_original_size = len(second_model.applications[DATABASE_APP_NAME].units) await gather( scale_application( - ops_test, DATABASE_APP_NAME, first_cluster_original_size + 1, timeout=2500 + ops_test, DATABASE_APP_NAME, first_cluster_original_size + 1, timeout=3000 ), scale_application( ops_test, DATABASE_APP_NAME, second_cluster_original_size + 1, model=second_model, - timeout=2500, + timeout=3000, ), ) From 2fc2cc7c317dee1064a749e8f0ba8441f985e771 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Wed, 11 Jun 2025 12:16:19 +0300 Subject: [PATCH 08/13] Try to scale without ffwd --- .../ha_tests/test_async_replication.py | 53 +++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/tests/integration/ha_tests/test_async_replication.py b/tests/integration/ha_tests/test_async_replication.py index 4c5b63a7ed..be83888941 100644 --- a/tests/integration/ha_tests/test_async_replication.py +++ b/tests/integration/ha_tests/test_async_replication.py @@ -529,36 +529,35 @@ async def test_scaling( logger.info("checking whether writes are increasing") await are_writes_increasing(ops_test) - async with ops_test.fast_forward(FAST_INTERVAL), fast_forward(second_model, FAST_INTERVAL): - logger.info("scaling out the clusters") - first_cluster_original_size = len(first_model.applications[DATABASE_APP_NAME].units) - second_cluster_original_size = len(second_model.applications[DATABASE_APP_NAME].units) - await gather( - scale_application( - ops_test, DATABASE_APP_NAME, first_cluster_original_size + 1, timeout=3000 - ), - scale_application( - ops_test, - DATABASE_APP_NAME, - second_cluster_original_size + 1, - model=second_model, - timeout=3000, - ), - ) + logger.info("scaling out the clusters") + first_cluster_original_size = len(first_model.applications[DATABASE_APP_NAME].units) + second_cluster_original_size = len(second_model.applications[DATABASE_APP_NAME].units) + await gather( + scale_application( + ops_test, DATABASE_APP_NAME, first_cluster_original_size + 1, timeout=2500 + ), + scale_application( + ops_test, + DATABASE_APP_NAME, + second_cluster_original_size + 1, + model=second_model, + timeout=2500, + ), + ) - logger.info("checking whether writes are increasing") - await are_writes_increasing(ops_test, extra_model=second_model) + logger.info("checking whether writes are increasing") + await are_writes_increasing(ops_test, extra_model=second_model) - logger.info("scaling in the clusters") - await gather( - scale_application(ops_test, DATABASE_APP_NAME, first_cluster_original_size), - scale_application( - ops_test, DATABASE_APP_NAME, second_cluster_original_size, model=second_model - ), - ) + logger.info("scaling in the clusters") + await gather( + scale_application(ops_test, DATABASE_APP_NAME, first_cluster_original_size), + scale_application( + ops_test, DATABASE_APP_NAME, second_cluster_original_size, model=second_model + ), + ) - logger.info("checking whether writes are increasing") - await are_writes_increasing(ops_test, extra_model=second_model) + logger.info("checking whether writes are increasing") + await are_writes_increasing(ops_test, extra_model=second_model) # Verify that no writes to the database were missed after stopping the writes # (check that all the units have all the writes). From ea5a82323a3124956230e4cd4f3a1305eb0f0a52 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Wed, 11 Jun 2025 16:21:52 +0300 Subject: [PATCH 09/13] Try not to defer rel changed --- src/relations/postgresql_provider.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/relations/postgresql_provider.py b/src/relations/postgresql_provider.py index e927b96b92..52cc9ad3b7 100644 --- a/src/relations/postgresql_provider.py +++ b/src/relations/postgresql_provider.py @@ -170,9 +170,12 @@ def _on_relation_changed(self, event: RelationChangedEvent) -> None: # Check for some conditions before trying to access the PostgreSQL instance. if not self.charm.is_cluster_initialised: logger.debug( - "Deferring on_relation_changed: Cluster must be initialized before configuration can be updated with relation users" + "Early exit on_relation_changed: Cluster must be initialized before configuration can be updated with relation users" ) - event.defer() + return + + if not self.charm._patroni.member_started: + logger.debug("Early exit on_relation_changed: Member not started yet") return user = f"relation-{event.relation.id}" From 7db1967dd960a8abf82b3af19e2e2ab558943ce7 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Wed, 11 Jun 2025 18:03:04 +0300 Subject: [PATCH 10/13] Remove extra hook --- src/relations/postgresql_provider.py | 28 -------------------------- tests/unit/test_postgresql_provider.py | 3 --- 2 files changed, 31 deletions(-) diff --git a/src/relations/postgresql_provider.py b/src/relations/postgresql_provider.py index 52cc9ad3b7..897967b601 100644 --- a/src/relations/postgresql_provider.py +++ b/src/relations/postgresql_provider.py @@ -73,9 +73,6 @@ def __init__(self, charm: "PostgresqlOperatorCharm", relation_name: str = "datab self.framework.observe( self.database_provides.on.database_requested, self._on_database_requested ) - self.framework.observe( - charm.on[self.relation_name].relation_changed, self._on_relation_changed - ) @staticmethod def _sanitize_extra_roles(extra_roles: str | None) -> list[str]: @@ -166,31 +163,6 @@ def _on_database_requested(self, event: DatabaseRequestedEvent) -> None: except RetryError: logger.warning("database requested: Unable to check pg_hba rule update") - def _on_relation_changed(self, event: RelationChangedEvent) -> None: - # Check for some conditions before trying to access the PostgreSQL instance. - if not self.charm.is_cluster_initialised: - logger.debug( - "Early exit on_relation_changed: Cluster must be initialized before configuration can be updated with relation users" - ) - return - - if not self.charm._patroni.member_started: - logger.debug("Early exit on_relation_changed: Member not started yet") - return - - user = f"relation-{event.relation.id}" - try: - if user not in self.charm.postgresql.list_users(): - logger.debug("Deferring on_relation_changed: user was not created yet") - event.defer() - return - except PostgreSQLListUsersError: - logger.debug("Deferring on_relation_changed: failed to list users") - event.defer() - return - - self.charm.update_config() - def _on_relation_broken(self, event: RelationBrokenEvent) -> None: """Correctly update the status.""" self._update_unit_status(event.relation) diff --git a/tests/unit/test_postgresql_provider.py b/tests/unit/test_postgresql_provider.py index 5fc29dd5c7..b6091e52bb 100644 --- a/tests/unit/test_postgresql_provider.py +++ b/tests/unit/test_postgresql_provider.py @@ -96,9 +96,6 @@ def request_database(_harness): def test_on_database_requested(harness): with ( patch("charm.PostgresqlOperatorCharm.update_config"), - patch( - "relations.postgresql_provider.PostgreSQLProvider._on_relation_changed" - ) as _on_relation_changed, patch.object(PostgresqlOperatorCharm, "postgresql", Mock()) as postgresql_mock, patch("subprocess.check_output", return_value=b"C"), patch("charm.PostgreSQLProvider.update_endpoints") as _update_endpoints, From 709e9f335241b039a84fbc37619c12bd7fb3866f Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Thu, 12 Jun 2025 00:48:52 +0300 Subject: [PATCH 11/13] Check if patroni is running before calling the health endpoint --- src/cluster.py | 12 ++++++++++++ tests/unit/test_cluster.py | 3 +++ 2 files changed, 15 insertions(+) diff --git a/src/cluster.py b/src/cluster.py index 34954ca593..a16360c823 100644 --- a/src/cluster.py +++ b/src/cluster.py @@ -495,6 +495,8 @@ def member_started(self) -> bool: True if services is ready False otherwise. Retries over a period of 60 seconds times to allow server time to start up. """ + if not self.is_patroni_running(): + return False try: response = self.get_patroni_health() except RetryError: @@ -979,6 +981,16 @@ def reload_patroni_configuration(self): timeout=PATRONI_TIMEOUT, ) + def is_patroni_running(self) -> bool: + """Check if the Patroni service is running.""" + try: + cache = snap.SnapCache() + selected_snap = cache["charmed-postgresql"] + return selected_snap.services["patroni"]["active"] + except snap.SnapError as e: + logger.debug(f"Failed to check Patroni service: {e}") + return False + def restart_patroni(self) -> bool: """Restart Patroni. diff --git a/tests/unit/test_cluster.py b/tests/unit/test_cluster.py index 2f89a880e8..1d4afe7612 100644 --- a/tests/unit/test_cluster.py +++ b/tests/unit/test_cluster.py @@ -562,6 +562,7 @@ def test_member_started_true(peers_ips, patroni): patch("cluster.requests.get") as _get, patch("cluster.stop_after_delay", return_value=stop_after_delay(0)), patch("cluster.wait_fixed", return_value=wait_fixed(0)), + patch("charm.Patroni.is_patroni_running", return_value=True), ): _get.return_value.json.return_value = {"state": "running"} @@ -580,6 +581,7 @@ def test_member_started_false(peers_ips, patroni): patch("cluster.requests.get") as _get, patch("cluster.stop_after_delay", return_value=stop_after_delay(0)), patch("cluster.wait_fixed", return_value=wait_fixed(0)), + patch("charm.Patroni.is_patroni_running", return_value=True), ): _get.return_value.json.return_value = {"state": "stopped"} @@ -598,6 +600,7 @@ def test_member_started_error(peers_ips, patroni): patch("cluster.requests.get") as _get, patch("cluster.stop_after_delay", return_value=stop_after_delay(0)), patch("cluster.wait_fixed", return_value=wait_fixed(0)), + patch("charm.Patroni.is_patroni_running", return_value=True), ): _get.side_effect = Exception From f8600d234e8a9330310f70bb553f998f2ddaefc4 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Thu, 12 Jun 2025 02:13:46 +0300 Subject: [PATCH 12/13] Revert timeout --- tests/integration/ha_tests/test_async_replication.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/integration/ha_tests/test_async_replication.py b/tests/integration/ha_tests/test_async_replication.py index be83888941..c9aed42e30 100644 --- a/tests/integration/ha_tests/test_async_replication.py +++ b/tests/integration/ha_tests/test_async_replication.py @@ -533,15 +533,12 @@ async def test_scaling( first_cluster_original_size = len(first_model.applications[DATABASE_APP_NAME].units) second_cluster_original_size = len(second_model.applications[DATABASE_APP_NAME].units) await gather( - scale_application( - ops_test, DATABASE_APP_NAME, first_cluster_original_size + 1, timeout=2500 - ), + scale_application(ops_test, DATABASE_APP_NAME, first_cluster_original_size + 1), scale_application( ops_test, DATABASE_APP_NAME, second_cluster_original_size + 1, model=second_model, - timeout=2500, ), ) From 3c98a2c721c4865ee8dc474bb2c302e7fa4858c9 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Thu, 12 Jun 2025 13:38:48 +0300 Subject: [PATCH 13/13] Pass the timeout param --- tests/integration/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/helpers.py b/tests/integration/helpers.py index 1514cee62f..ae49c35c5a 100644 --- a/tests/integration/helpers.py +++ b/tests/integration/helpers.py @@ -1046,7 +1046,7 @@ async def scale_application( await model.wait_for_idle( apps=[application_name], status="active", - timeout=2000, + timeout=timeout, idle_period=idle_period, wait_for_exact_units=count, )