Skip to content

Commit

Permalink
fix(test): Add delayed replica test
Browse files Browse the repository at this point in the history
  • Loading branch information
tparsa committed Oct 1, 2023
1 parent 35a9bcc commit 8d5b920
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions deployment/integration-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 8d5b920

Please sign in to comment.