fixup! cluster/services/patroni: test in simulacrum

This commit is contained in:
Max Headroom 2024-08-14 03:07:58 +02:00
parent c9b12007ce
commit 75ec639648

View file

@ -128,7 +128,7 @@ in
with subtest("should be able to run queries while any one node is crashed"): with subtest("should be able to run queries while any one node is crashed"):
masterNodeName = nodes[0].succeed("patronictl list -f json ${clusterName} | jq '.[] | select(.Role | test(\"^Leader$\")) | .Member' -r").strip() masterNodeName = nodes[0].succeed("patronictl list -f json ${clusterName} | jq '.[] | select(.Role | test(\"^Leader$\")) | .Member' -r").strip()
masterNodeIndex = next((i for i, v in enumerate(nodes) if v.name == masterNodeName), None) masterNodeIndex = next((i for i, v in enumerate(nodes) if v.name == masterNodeName))
# Move master node at the end of the list to avoid multiple failovers (makes the test faster and more consistent) # Move master node at the end of the list to avoid multiple failovers (makes the test faster and more consistent)
nodes.append(nodes.pop(masterNodeIndex)) nodes.append(nodes.pop(masterNodeIndex))