fixup! fixup! fixup! cluster/services/patroni: test in simulacrum

This commit is contained in:
Max Headroom 2024-08-14 13:35:20 +02:00
parent 64fda7ed8f
commit cd89d5782b

View file

@ -98,6 +98,7 @@ in
def wait_for_all_nodes_ready(expected_replicas=2):
booted_nodes = booted(nodes)
for node in booted_nodes:
node.wait_for_unit("patroni.service")
print(node.succeed("patronictl list ${clusterName}"))
node.wait_until_succeeds(f"[ $(patronictl list -f json ${clusterName} | jq 'length') == {expected_replicas + 1} ]")
node.wait_until_succeeds("[ $(patronictl list -f json ${clusterName} | jq 'map(select(.Role | test(\"^Leader$\"))) | map(select(.State | test(\"^running$\"))) | length') == 1 ]")