Adam Stephens 2024-05-05 15:59:07 -04:00
parent 8bc61d8848
commit 3d20a75e9a
No known key found for this signature in database
2 changed files with 4 additions and 11 deletions

View file

@ -155,7 +155,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
print(node.succeed("patronictl list cluster1"))
node.wait_until_succeeds(f"[ $(patronictl list -f json cluster1 | jq 'length') == {expected_replicas + 1} ]")
node.wait_until_succeeds("[ $(patronictl list -f json cluster1 | jq 'map(select(.Role | test(\"^Leader$\"))) | map(select(.State | test(\"^running$\"))) | length') == 1 ]")
node.wait_until_succeeds(f"[ $(patronictl list -f json cluster1 | jq 'map(select(.Role | test(\"^Replica$\"))) | map(select(.State | test(\"^running$\"))) | length') == {expected_replicas} ]")
node.wait_until_succeeds(f"[ $(patronictl list -f json cluster1 | jq 'map(select(.Role | test(\"^Replica$\"))) | map(select(.State | test(\"^streaming$\"))) | length') == {expected_replicas} ]")
print(node.succeed("patronictl list cluster1"))
client.wait_until_succeeds("psql -h 127.0.0.1 -U postgres --command='select 1;'")

View file

@ -6,24 +6,17 @@
pythonPackages.buildPythonApplication rec {
pname = "patroni";
version = "2.1.3";
version = "3.3.0";
src = fetchFromGitHub {
owner = "zalando";
repo = pname;
rev = "v${version}";
sha256 = "sha256-cBkiBrty/6A3rIv9A1oh8GvPjwxhHwYEKuDIsNzHw1g=";
sha256 = "sha256-gOjjE++hf3GOimvCxBR0jqqi3JNpbejLcWbLHpz2H4Q=";
};
# cdiff renamed to ydiff; remove when patroni source reflects this.
postPatch = ''
for i in requirements.txt patroni/ctl.py tests/test_ctl.py; do
substituteInPlace $i --replace cdiff ydiff
done
'';
propagatedBuildInputs = with pythonPackages; [
boto
boto3
click
consul
dnspython