PG version is not seen in pg_upgrade test log

Potapov Alexander <a.potapov@postgrespro.com>

From: "Potapov Alexander" <a.potapov@postgrespro.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2025-11-30T09:11:44Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Show version of nodes in output of TAP tests

Attachments

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