Skip to content

Commit 8714ce7

Browse files
committed
Fixes for the new testgres 1.11.0
A new testgres framework was released that makes `PostgresNode::port` read-only. Fixed it by properly set the port when initializing a new node. References: https://github.com/postgrespro/testgres/releases/tag/1.11.0 postgrespro/testgres#234
1 parent f476b7a commit 8714ce7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎scripts/test_pg_upgrade.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def initialize_node(working_dir, prefix, port, bin_dir, base_dir):
4747
pg_node_old = f"pg{pg_version_old}"
4848
pg_node_new = f"pg{pg_version_new}"
4949

50-
pg_port_old = getenv_or_default("PGPORTOLD", "54321")
51-
pg_port_new = getenv_or_default("PGPORTNEW", "54322")
50+
pg_port_old = int(getenv_or_default("PGPORTOLD", "54321"))
51+
pg_port_new = int(getenv_or_default("PGPORTNEW", "54322"))
5252

5353
test_version = getenv_or_default("TEST_VERSION", "v8")
5454

@@ -94,12 +94,10 @@ def initialize_node(working_dir, prefix, port, bin_dir, base_dir):
9494
node_old.safe_psql(dbname=pg_database_test, query="CHECKPOINT")
9595
node_old.safe_psql(dbname=pg_database_test, filename="test/sql/updates/setup.check.sql")
9696

97-
# Run new psql over the old node to have the same psql output
98-
node_new.port = pg_port_old
99-
(code, old_out, old_err) = node_new.psql(
97+
# Run over the old node to check the output
98+
(code, old_out, old_err) = node_old.psql(
10099
dbname=pg_database_test, filename="test/sql/updates/post.pg_upgrade.sql"
101100
)
102-
node_new.port = pg_port_new
103101

104102
# Save output to log
105103
write_bytes_to_file(f"{working_dir}/post.{pg_node_old}.log", old_out)

0 commit comments

Comments
 (0)