Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
5fb720b
disbale default user and add charmed-operator user and password gener…
skourta Jan 19, 2026
93f8b41
add secret handlign and config for admin password
skourta Jan 19, 2026
a0e62d4
bind to 0.0.0.0
skourta Jan 20, 2026
c7caead
switch to glide
skourta Jan 20, 2026
af42d57
add unit tests
skourta Jan 20, 2026
8889bd5
add integeration tests
skourta Jan 20, 2026
7157121
add install deps to ci unit tests
skourta Jan 20, 2026
90750a1
add sudo to apt
skourta Jan 20, 2026
6a80e46
install protobug for glide on integration tests
skourta Jan 20, 2026
301e627
auto approve installing deps
skourta Jan 21, 2026
2be061c
update rust
skourta Jan 21, 2026
e2ea39f
sudo apt
skourta Jan 21, 2026
07353c3
set default rust on spread
skourta Jan 21, 2026
a8a2f18
save acl after udpating password so the change persists across restarts
skourta Jan 21, 2026
87c443e
feedback from rene
skourta Jan 22, 2026
2cd5c8b
switch updating password to write acl file and then load it
skourta Jan 22, 2026
1f73be7
implement feedback
skourta Jan 26, 2026
b51956d
add different charm users
skourta Jan 27, 2026
1615306
update passwords on non leader units
skourta Jan 27, 2026
7aa4505
chagne scope of status for units and fix exception catching
skourta Jan 27, 2026
c63f21e
fixing unit tests WIP
skourta Jan 27, 2026
9093a80
Merge branch '9/edge' into create-all-charm-users
skourta Jan 28, 2026
d8e2754
small charm restructure and enahnce unit tests
skourta Jan 28, 2026
fc9c9d3
fix integration tests
skourta Jan 28, 2026
3bc8774
add wrong username update test
skourta Jan 28, 2026
b812847
fix copilot feedback
skourta Jan 28, 2026
913f85f
fix unit tests
skourta Jan 28, 2026
073f087
add charm sentinel user
skourta Jan 28, 2026
f6a8489
initial scale up implementation
skourta Jan 29, 2026
9d36b0f
Merge branch 'DPE-9135-create-all-charm-users' into DPE-9174-scale-up
skourta Jan 29, 2026
12e63fb
set sentinel acl file
skourta Jan 29, 2026
935d794
add monitoring user
skourta Jan 29, 2026
be9de60
Merge branch 'DPE-9135-create-all-charm-users' into DPE-9174-scale-up
skourta Jan 29, 2026
9b27441
revert back secret name
skourta Jan 29, 2026
7a70828
Merge branch 'DPE-9135-create-all-charm-users' into DPE-9174-scale-up
skourta Jan 29, 2026
3f2177e
update users for acls and configs
skourta Jan 29, 2026
31c217a
add update primaryauth on password change
skourta Jan 29, 2026
b5a9bea
switch to ips instead of hostnames
skourta Jan 29, 2026
ef5415a
fix unit tests and remove checks from manager
skourta Jan 29, 2026
888ffbd
add statuses for starting
skourta Jan 29, 2026
5f2bc81
fix unit tests
skourta Jan 29, 2026
79b45f0
switch from valkey glide to valkey cli with subprocess
skourta Jan 30, 2026
b1b4f06
add unit local admin password and fix integration tests
skourta Jan 30, 2026
577171e
fix unit tests
skourta Jan 30, 2026
c74a27a
switch away from glide for integration tests
skourta Jan 30, 2026
2f00f1f
add replica password change and check on all units
skourta Jan 30, 2026
827e58d
add continuouswrites file
skourta Jan 30, 2026
199492b
Merge branch '9/edge' into DPE-9174-scale-up
skourta Feb 4, 2026
72e4b4f
add first integration test for scale up
skourta Feb 4, 2026
38923b1
add scaling spread file
skourta Feb 4, 2026
c436a4a
mock get_private_ip
skourta Feb 4, 2026
6ea5fa2
remove markers and etcd references
skourta Feb 4, 2026
bfc60e9
Merge branch '9/edge' into DPE-9174-scale-up
skourta Feb 5, 2026
21e1837
fix unit tests and add some workload functions
skourta Feb 5, 2026
c48daeb
add mode user and group to write file
skourta Feb 5, 2026
25d25b8
fix integration tests
skourta Feb 6, 2026
e8db36c
add one-by-one scaling up
skourta Feb 9, 2026
a6d02bd
add retries to sentinel discovery and replica sync check
skourta Feb 9, 2026
cde911e
better statuses
skourta Feb 9, 2026
1bf286e
Merge branch '9/edge' into DPE-9174-scale-up
skourta Feb 9, 2026
efac5a8
seed data and auto decode
skourta Feb 9, 2026
c165c68
add different scenarios for unit test non leader starting
skourta Feb 9, 2026
230b4e5
update vm tests
skourta Feb 9, 2026
3dbb471
remove primary ip from databag
skourta Feb 9, 2026
8b50dff
fix unit tests
skourta Feb 9, 2026
7c553be
fix vm startup
skourta Feb 10, 2026
40fb300
move spread file to correct position
skourta Feb 10, 2026
50db852
enable sentinel on VM
skourta Feb 10, 2026
d60a25b
mv cw to the base of integration tests
skourta Feb 10, 2026
76a9b52
add scaling tests on VM
skourta Feb 10, 2026
bc3b51b
fix typos
skourta Feb 10, 2026
47f5c12
fix typo
skourta Feb 10, 2026
9a6f877
remove resource from vm test scaling
skourta Feb 10, 2026
1fdc7e9
remove scaling comment and update cw to be pythonic
skourta Feb 11, 2026
3218f37
remove unused patch
skourta Feb 11, 2026
e46b5f3
turn off write logging for CW
skourta Feb 11, 2026
7c5afc2
add sentinel as daemon for vm and fix permissions for files
skourta Feb 11, 2026
5244669
fix role for valkey sentinel user
skourta Feb 11, 2026
9a0a081
update to the new rock and its user
skourta Feb 12, 2026
60504e2
only log the command no arguments to avoid leaking secrets
skourta Feb 12, 2026
ea71353
refactored start procedure and added rene feedback
skourta Feb 13, 2026
ab3e4c5
fix unit tests and fine tune statuses
skourta Feb 13, 2026
99562f0
fixes for rene feedback
skourta Feb 13, 2026
4258bd5
remove get_private_ip and replace it with bind_address
skourta Feb 13, 2026
d00c206
add unit tests for peer relation changed
skourta Feb 13, 2026
ee7f331
fix some feedback from mehdi
skourta Feb 16, 2026
0c4eb4e
refactor client and add health checks
skourta Feb 16, 2026
994e852
mock tenacity nap times and fix unit tests
skourta Feb 16, 2026
53a6285
update name of charmed_operator_password for units
skourta Feb 16, 2026
7e616ed
remove unnecessary check on admin app password
skourta Feb 16, 2026
a9f33da
add alive check in start
skourta Feb 16, 2026
d5c3a01
remove refresh argument from reading secret
skourta Feb 17, 2026
bf491e8
read and manage sentinel config via a dict
skourta Feb 17, 2026
27a6e23
move workload fields to be body annotations
skourta Feb 17, 2026
178f560
some minor changes based on feedback
skourta Feb 17, 2026
ed477cf
simplify and generalise start up logic
skourta Feb 18, 2026
d4aa771
remove unnecessary state and fix unit tests
skourta Feb 18, 2026
3beea80
only leader starts priomary if num of units is 0
skourta Feb 18, 2026
eeddaad
clean the cases where primary ip is None and set a blocked status if …
skourta Feb 18, 2026
f2e80b0
extend unit test coverage and rename unit tests to reflect business l…
skourta Feb 18, 2026
68b89a4
leader has to start primary because non leaders might not see all uni…
skourta Feb 18, 2026
250e39b
add running status for better UX
skourta Feb 19, 2026
147240f
move to glide and wrap client requests in helpers
skourta Feb 19, 2026
cb3e0ec
install charmed-valkey snap
skourta Feb 19, 2026
95abc33
add sudo and snap to allowlist
skourta Feb 19, 2026
7d51cb4
mv from snap to downloading cli
skourta Feb 19, 2026
c1fa74e
switch creating glie client to context manager to close connection au…
skourta Feb 20, 2026
dfbde41
wip scale down
skourta Feb 20, 2026
ec578b7
revert back is sentinel discovered argument
skourta Feb 20, 2026
a14839d
statuses for scale down
skourta Feb 24, 2026
487ec64
refactor client tp separate valkey and sentinel and use json where po…
skourta Feb 25, 2026
b300ccd
only recompute model when writing to databag
skourta Feb 25, 2026
40789bf
client refactoring and added delief
skourta Feb 25, 2026
46cb2a9
refactor locks to adhere to ux of advanced rollingops
skourta Feb 25, 2026
01e8a73
refactor managers to use the new clients
skourta Feb 25, 2026
c825223
refactor verify_expected_replica_count
skourta Feb 25, 2026
f9c37f8
update base events with new refactoring
skourta Feb 25, 2026
674b96f
remove unnecessary debug log
skourta Feb 25, 2026
610d333
Merge branch '9/edge' into DPE-9324-scale-down
skourta Feb 26, 2026
733dbd1
shorten statuses
skourta Feb 26, 2026
b1258b4
fix unit tests and change some function names on client
skourta Feb 26, 2026
cbe8f66
remove unnecessary catches
skourta Feb 26, 2026
b30e1e9
add scale down unit tests
skourta Feb 26, 2026
e2ba6ef
only try to update passwords on valkey if it is started
skourta Feb 26, 2026
ba0ccc0
add k8s scaledown tests
skourta Feb 26, 2026
9949da3
fix unit tests
skourta Feb 26, 2026
d4cfb59
handle scale down to 0
skourta Feb 26, 2026
ac4348b
fix unit test
skourta Feb 26, 2026
3fed063
add scaling down to 0 and back
skourta Feb 26, 2026
e2a4964
clear cw
skourta Feb 26, 2026
7288292
fix linter
skourta Feb 26, 2026
b521089
add remove app test
skourta Feb 26, 2026
e6267cb
copilot feedback
skourta Feb 27, 2026
f103091
port fix from tls for leader elected event
skourta Feb 27, 2026
a8f8912
cw use databag to filter units and use helper to remove units on both…
skourta Mar 3, 2026
d796c8c
Merge branch '9/edge' into DPE-9324-scale-down
skourta Mar 3, 2026
7ea8175
add c_writes to scale down
skourta Mar 3, 2026
64bb344
fail faster if any hostname is down
skourta Mar 3, 2026
320d17d
rename tests so we can easily run all scale down tests using -k
skourta Mar 3, 2026
ce045e4
vm agnostic test
skourta Mar 3, 2026
71008c5
add scale down primary test on vm
skourta Mar 3, 2026
3fef2bf
feedback from rene
skourta Mar 4, 2026
f500b43
add a todo comment
skourta Mar 4, 2026
49f8826
lint and add clearing c_writes
skourta Mar 4, 2026
fde927f
increase cw request timeout to 1s
skourta Mar 4, 2026
f56dd74
remove unneeded raises and augment unit test coverage for sentinel ma…
skourta Mar 4, 2026
2dee78c
reduce request timeout
skourta Mar 4, 2026
d327afd
Merge branch '9/edge' into DPE-9324-scale-down
skourta Mar 4, 2026
5fe97f0
fix conflicts
skourta Mar 4, 2026
f15a45a
add is_tls_enabled property
skourta Mar 10, 2026
c8e40d6
Merge branch '9/edge' into DPE-9324-scale-down
skourta Mar 10, 2026
f87db82
add primary ip to valkey lock
skourta Mar 10, 2026
10940e4
try to get primary ip for 40s and clean certicicates on leader going out
skourta Mar 10, 2026
d6a0bce
fix and increase unit tests
skourta Mar 10, 2026
75a90d3
lint
skourta Mar 10, 2026
867e699
feedback from rene
skourta Mar 11, 2026
e094a15
add quorum reconfig based on cluster size
skourta Mar 12, 2026
d2826dd
format
skourta Mar 12, 2026
b3ff254
fix and add unit tests
skourta Mar 12, 2026
cace9f5
give enough time to the client to try other addresses
skourta Mar 12, 2026
0bf408e
[DPE-9373]: Use hostnames instead of IPs for k8s (#19)
skourta Mar 13, 2026
66aa45a
Merge branch 'DPE-9324-scale-down' into dpe-9510-quorum-management
skourta Mar 13, 2026
d00a189
remove f strings in loggers
skourta Mar 17, 2026
abe43b9
charm level feedback
skourta Mar 17, 2026
d801de9
rename ip to endpoint and add existing app
skourta Mar 17, 2026
4dc6340
add support for existing app in scale tests
skourta Mar 17, 2026
4e399a8
patch is_failover_in_progress
skourta Mar 17, 2026
cb1138d
Merge branch '9/edge' into DPE-9324-scale-down
skourta Mar 18, 2026
a931e7c
only remove APP_NAME in tests
skourta Mar 18, 2026
d0aeff6
minor feedback
skourta Mar 18, 2026
4f979c8
Merge branch 'DPE-9324-scale-down' into dpe-9510-quorum-management
skourta Mar 18, 2026
449bce4
fix unit tests
skourta Mar 18, 2026
a99f9c4
Merge branch '9/edge' into dpe-9510-quorum-management
skourta Mar 18, 2026
0358c3b
increase idle times to stabilize tests
skourta Mar 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/common/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,21 @@ def sentinels_primary(self, hostname: str) -> list[dict[str, str]]:
return self.exec_cli_command(
command=["sentinel", "sentinels", PRIMARY_NAME], hostname=hostname
)

def set(self, hostname: str, *args: str) -> bool:
"""Set a sentinel configuration parameter through the CLI.

Args:
hostname (str): The hostname to connect to.
*args (str): The sentinel configuration parameters to set, as a variable list of strings.

Returns:
bool: True if the command executed successfully, False otherwise.
"""
return (
self.exec_cli_command(
command=["sentinel", "set"] + list(args),
hostname=hostname,
)
== "OK"
)
30 changes: 30 additions & 0 deletions src/events/base_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def __init__(self, charm: "ValkeyCharm"):
self.framework.observe(
self.charm.on[PEER_RELATION].relation_changed, self._on_peer_relation_changed
)
self.framework.observe(
self.charm.on[PEER_RELATION].relation_departed, self._on_peer_relation_departed
)
self.framework.observe(self.charm.on.update_status, self._on_update_status)
self.framework.observe(self.charm.on.leader_elected, self._on_leader_elected)
self.framework.observe(self.charm.on.config_changed, self._on_config_changed)
Expand Down Expand Up @@ -227,12 +230,18 @@ def _on_unit_fully_started(self, event: UnitFullyStarted) -> None:

def _on_peer_relation_changed(self, event: ops.RelationChangedEvent) -> None:
"""Handle event received by all units when a unit's relation data changes."""
self._reconfigure_quorum_if_necessary()

if not self.charm.unit.is_leader():
return

for lock in [StartLock(self.charm.state)]:
lock.process()

def _on_peer_relation_departed(self, event: ops.RelationDepartedEvent) -> None:
"""Handle event received by all units when a unit departs."""
self._reconfigure_quorum_if_necessary()

def _on_update_status(self, event: ops.UpdateStatusEvent) -> None:
"""Handle the update-status event."""
if not self.charm.state.unit_server.is_started:
Expand Down Expand Up @@ -524,3 +533,24 @@ def _set_state_for_going_away(self) -> None:
)

self.charm.state.unit_server.update({"scale_down_state": ScaleDownState.GOING_AWAY})

def _reconfigure_quorum_if_necessary(self) -> None:
"""Reconfigure the sentinel quorum if it does not match the current cluster size."""
# if the unit / all units are being removed, we do not need to reconfigure the quorum
if (
not self.charm.state.unit_server.is_active
or self.charm.state.unit_server.is_being_removed
or self.model.app.planned_units() == 0
):
return

if self.charm.sentinel_manager.get_configured_quorum() != self.charm.config_manager.quorum:
logger.debug("Updating sentinel quorum to match current cluster size")
try:
self.charm.sentinel_manager.set_quorum(self.charm.config_manager.quorum)
self.charm.config_manager.set_sentinel_config_properties(
self.charm.sentinel_manager.get_primary_ip()
)
except ValkeyWorkloadCommandError as e:
logger.error(f"Failed to update sentinel quorum: {e}")
# not critical to defer here, we can wait for the next relation change or config change to try again
Comment on lines +547 to +556
12 changes: 7 additions & 5 deletions src/managers/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
CHARM_USERS_ROLE_MAP,
CLIENT_PORT,
PRIMARY_NAME,
QUORUM_NUMBER,
SENTINEL_PORT,
SENTINEL_TLS_PORT,
TLS_PORT,
Expand Down Expand Up @@ -256,10 +255,7 @@ def get_sentinel_config_properties(
def _generate_sentinel_configs(self, primary_endpoint: str) -> dict[str, str]:
"""Generate the sentinel config properties based on the current cluster state."""
sentinel_configs = {}
# TODO consider adding quorum calculation based on number of planned_units and the parity of the number of units
sentinel_configs["monitor"] = (
f"{PRIMARY_NAME} {primary_endpoint} {TLS_PORT} {QUORUM_NUMBER}"
)
sentinel_configs["monitor"] = f"{PRIMARY_NAME} {primary_endpoint} {TLS_PORT} {self.quorum}"
# auth settings
# auth-user is used by sentinel to authenticate to the valkey primary
sentinel_configs["auth-user"] = f"{PRIMARY_NAME} {CharmUsers.VALKEY_SENTINEL.value}"
Expand Down Expand Up @@ -363,6 +359,12 @@ def configure_services(self, primary_endpoint: str) -> None:
)
raise ValkeyConfigurationError("Failed to set configuration") from e

@property
def quorum(self) -> int:
"""Calculate the quorum based on the number of units in the cluster."""
num_units = len([server for server in self.state.servers if server.is_active])
return (num_units // 2) + 1

def get_statuses(self, scope: Scope, recompute: bool = False) -> list[StatusObject]:
"""Compute the config manager's statuses."""
status_list: list[StatusObject] = []
Expand Down
12 changes: 11 additions & 1 deletion src/managers/sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
)
from core.base_workload import WorkloadBase
from core.cluster_state import ClusterState
from literals import CharmUsers
from literals import PRIMARY_NAME, CharmUsers
from statuses import CharmStatuses

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -316,3 +316,13 @@ def get_primary_ip_for_scale_down(self) -> str:
40s covers both substrates
"""
return self.get_primary_ip()

def get_configured_quorum(self) -> int:
"""Get the currently configured quorum for the sentinel cluster."""
client = self._get_sentinel_client()
return int(client.primary(self.state.bind_address)["quorum"])

def set_quorum(self, quorum: int) -> None:
"""Set the quorum for the sentinel cluster."""
client = self._get_sentinel_client()
client.set(self.state.bind_address, PRIMARY_NAME, "quorum", str(quorum))
Comment on lines +323 to +328
4 changes: 2 additions & 2 deletions tests/integration/continuous_writes.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async def _create_glide_client(self, config: Optional[SimpleNamespace] = None) -
glide_config = GlideClientConfiguration(
addresses=addresses,
client_name="continuous_writes_client",
request_timeout=500,
request_timeout=1000,
credentials=credentials,
reconnect_strategy=BackoffStrategy(num_of_retries=1, factor=50, exponent_base=2),
)
Expand Down Expand Up @@ -253,7 +253,7 @@ async def _make_client(conf: SimpleNamespace) -> GlideClient:
glide_config = GlideClientConfiguration(
addresses=addresses,
client_name="continuous_writes_worker",
request_timeout=500,
request_timeout=1000,
credentials=credentials,
reconnect_strategy=BackoffStrategy(num_of_retries=1, factor=50, exponent_base=2),
)
Expand Down
19 changes: 19 additions & 0 deletions tests/integration/ha/test_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
get_number_connected_replicas,
get_password,
get_primary_ip,
get_quorum,
remove_number_units,
seed_valkey,
)
Expand Down Expand Up @@ -58,6 +59,15 @@ async def test_seed_data(juju: jubilant.Juju) -> None:
await seed_valkey(juju, target_gb=1)


async def test_check_quorum(juju: jubilant.Juju) -> None:
"""Check quorum value."""
app_name = existing_app(juju) or APP_NAME
init_units_count = len(juju.status().apps[app_name].units)
assert get_quorum(juju, f"{app_name}/0") == (init_units_count // 2) + 1, (
"Unexpected quorum value after initial deploy"
)


async def test_scale_up(juju: jubilant.Juju, c_writes) -> None:
"""Make sure new units are added to the valkey downtime."""
app_name = existing_app(juju) or APP_NAME
Expand All @@ -78,6 +88,9 @@ async def test_scale_up(juju: jubilant.Juju, c_writes) -> None:
f"Expected {init_units_count + 2} units, got {num_units}."
)

for unit in juju.status().apps[app_name].units:
assert get_quorum(juju, unit) == (num_units // 2) + 1

# check if all units have been added to the cluster
hostnames = get_cluster_hostnames(juju, app_name)

Expand Down Expand Up @@ -145,6 +158,9 @@ async def test_scale_down_one_unit(juju: jubilant.Juju, substrate: Substrate, c_
f"Expected {init_units_count - 1} units, got {num_units}."
)

for unit in juju.status().apps[app_name].units:
assert get_quorum(juju, unit) == (num_units // 2) + 1

number_of_replicas = await get_number_connected_replicas(
hostnames=get_cluster_hostnames(juju, app_name),
username=CharmUsers.VALKEY_ADMIN.value,
Expand Down Expand Up @@ -225,6 +241,9 @@ async def test_scale_down_multiple_units(
f"Expected {init_units_count - 3} connected replicas, got {number_of_replicas}."
)

for unit in juju.status().apps[app_name].units:
assert get_quorum(juju, unit) == (num_units // 2) + 1

c_writes.update()

await assert_continuous_writes_increasing(
Expand Down
31 changes: 29 additions & 2 deletions tests/integration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
INTERNAL_USERS_PASSWORD_CONFIG,
INTERNAL_USERS_SECRET_LABEL_SUFFIX,
PEER_RELATION,
SENTINEL_PORT,
TLS_PORT,
CharmUsers,
Substrate,
Expand Down Expand Up @@ -467,10 +468,15 @@ async def seed_valkey(juju: jubilant.Juju, target_gb: float = 1.0) -> None:


def exec_valkey_cli(
hostname: str, username: str, password: str, command: str
hostname: str,
username: str,
password: str,
command: str,
port: int = CLIENT_PORT,
json: bool = False,
) -> valkey_cli_result:
"""Execute a Valkey CLI command and returns the output as a string."""
command = f"valkey-cli --no-auth-warning -h {hostname} -p {CLIENT_PORT} --user {username} --pass {password} {command}"
command = f"valkey-cli --no-auth-warning -h {hostname} -p {port} --user {username} --pass {password} {'--json' if json else ''} {command}"
result = subprocess.run(
command.split(), check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
)
Expand All @@ -479,6 +485,27 @@ def exec_valkey_cli(
)


def get_quorum(juju: jubilant.Juju, unit_name: str) -> int:
"""Get the currently configured sentinel quorum."""
status = juju.status()
model_info = juju.show_model()
units = status.get_units(APP_NAME)
unit_endpoint = (
units[unit_name].public_address
if model_info.type != "kubernetes"
else units[unit_name].address
)
Comment on lines +488 to +497
result = exec_valkey_cli(
hostname=unit_endpoint,
username=CharmUsers.SENTINEL_CHARM_ADMIN.value,
password=get_password(juju, user=CharmUsers.SENTINEL_CHARM_ADMIN),
command="SENTINEL primary primary",
port=SENTINEL_PORT,
json=True,
Comment on lines +498 to +504
)
return int(json.loads(result.stdout)["quorum"])


async def set_key(
hostnames: list[str],
username: str,
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async def test_update_admin_password(juju: jubilant.Juju) -> None:

# wait for config-changed hook to finish executing
juju.wait(
lambda status: are_apps_active_and_agents_idle(status, APP_NAME, idle_period=10),
lambda status: are_apps_active_and_agents_idle(status, APP_NAME, idle_period=30),
timeout=1200,
)

Expand Down Expand Up @@ -164,7 +164,7 @@ async def test_update_admin_password_wrong_username(juju: jubilant.Juju) -> None
set_password(juju, username=CharmUsers.VALKEY_ADMIN.value, password=new_password)
# wait for config-changed hook to finish executing
juju.wait(
lambda status: are_apps_active_and_agents_idle(status, APP_NAME, idle_period=10),
lambda status: are_apps_active_and_agents_idle(status, APP_NAME, idle_period=30),
timeout=1200,
)

Expand Down Expand Up @@ -224,7 +224,7 @@ async def test_user_secret_permissions(juju: jubilant.Juju) -> None:
with fast_forward(juju):
juju.grant_secret(identifier=secret_name, app=APP_NAME)
juju.wait(
lambda status: are_apps_active_and_agents_idle(status, APP_NAME, idle_period=10),
lambda status: are_apps_active_and_agents_idle(status, APP_NAME, idle_period=30),
timeout=1200,
)

Expand Down
Loading
Loading