PG version is not seen in pg_upgrade test log

From: "Potapov Alexander" <a(dot)potapov(at)postgrespro(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: PG version is not seen in pg_upgrade test log
Date: 2025-11-30 09:11:44
Message-ID: e59bb-692c0a80-5-6f987180@170377126
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello!

I ran pg_upgrade tests (make check -C src/bin/pg_upgrade) and found that test log does not contain PG version:
(file: src/bin/pg_upgrade/tmp_check/log/regress_log_002_pg_upgrade)
Name: old_node
Data directory: /home/dev/code/postgrespro3/src/bin/pg_upgrade/tmp_check/t_002_pg_upgrade_old_node_data/pgdata
Backup directory: /home/dev/code/postgrespro3/src/bin/pg_upgrade/tmp_check/t_002_pg_upgrade_old_node_data/backup
This happens because $node->_set_pg_version is called after invocation of $node->dump_info. To fix it we should change line order in Cluster.pm file. The result looks like:
Name: old_node
Version: 19devel
Data directory: /home/dev/code/postgrespro3/src/bin/pg_upgrade/tmp_check/t_002_pg_upgrade_old_node_data/pgdata
Backup directory: /home/dev/code/postgrespro3/src/bin/pg_upgrade/tmp_check/t_002_pg_upgrade_old_node_data/backup

The change I suggest is:
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -1647,10 +1647,10 @@ sub new
or
BAIL_OUT("could not create data directory \"$node->{_basedir}\": $!");
- $node->dump_info;
-
$node->_set_pg_version;
+ $node->dump_info;
+
my $ver = $node->{_pg_version};

Patch attached.

Best regards,
Alexander Potapov

Attachment Content-Type Size
0001-Show-PG-version-in-pg_upgrade-test-log.patch application/octet-stream 854 bytes

Browse pgsql-hackers by date

  From Date Subject
Previous Message Potapov Alexander 2025-11-30 08:21:27 Improve the test src/test/postmaster/t/003_start_stop.pl