From 8d5b92024dcd86ad8866f3bbfd035d2d144cff7c Mon Sep 17 00:00:00 2001 From: Parsa Date: Sun, 1 Oct 2023 19:31:32 +0330 Subject: [PATCH] fix(test): Add delayed replica test --- deployment/integration-test.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/deployment/integration-test.py b/deployment/integration-test.py index 8a61e2d..c9f2926 100644 --- a/deployment/integration-test.py +++ b/deployment/integration-test.py @@ -73,9 +73,16 @@ def check_same_query_on_replica_and_master_expect_unsync(replica_host, replica_p assert master_output != replica_output -def add_config(cluster_name, master_host, replica_slot, replica_port): +def add_config(cluster_name, master_host, replica_slot, replica_port, use_separate_wal_receive_service=False): + command = (f"pgkit config add --name {cluster_name} " + + "--version 12 --host {master_host}" + + " --port 5432 --dbname test --slot {replica_slot}" + + " --username testuser --password test-pass" + + " --replica-port {replica_port}") + if use_separate_wal_receive_service: + command += " --use-separate-wal-receive-service" subprocess.run( - f"pgkit config add --name {cluster_name} --version 12 --host {master_host} --port 5432 --dbname test --slot {replica_slot} --username testuser --password test-pass --replica-port {replica_port}", + command, shell=True ) @@ -129,7 +136,7 @@ def test_promote_backup(): def test_pitr_recover(): - add_config("pitr" , "master", "replicapitrslot", 5433) + add_config("pitr" , "master", "replicapitrslot", 5433, True) subprocess.run("pgkit pitr backup pitr 180", shell=True) open_pg_hba("pitr")