commit 2c8c78faba37f66c2ef88392f58ce8e241772300
Author: Anton A. Melnikov <a.melnikov@postgrespro.ru>
Date:   Fri Jun 3 23:50:14 2022 +0300

    Fix test for pg_upgrade from 10x versions.

diff --git a/src/bin/pg_upgrade/t/002_pg_upgrade.pl b/src/bin/pg_upgrade/t/002_pg_upgrade.pl
index 80437e93b7..d9d97b1b3d 100644
--- a/src/bin/pg_upgrade/t/002_pg_upgrade.pl
+++ b/src/bin/pg_upgrade/t/002_pg_upgrade.pl
@@ -58,7 +58,14 @@ my $oldnode =
 # To increase coverage of non-standard segment size and group access without
 # increasing test runtime, run these tests with a custom setting.
 # --allow-group-access and --wal-segsize have been added in v11.
-$oldnode->init(extra => [ '--wal-segsize', '1', '--allow-group-access' ]);
+my $ver_with_newopts = 11;
+my $oldver = $oldnode->{_pg_version};
+
+$oldnode->init(extra => [ '--wal-segsize', '1', '--allow-group-access' ])
+		if $oldver >= $ver_with_newopts;
+$oldnode->init()
+		if $oldver < $ver_with_newopts;
+
 $oldnode->start;
 
 # The default location of the source code is the root of this directory.
@@ -145,7 +152,10 @@ if (defined($ENV{oldinstall}))
 
 # Initialize a new node for the upgrade.
 my $newnode = PostgreSQL::Test::Cluster->new('new_node');
-$newnode->init(extra => [ '--wal-segsize', '1', '--allow-group-access' ]);
+$newnode->init(extra => [ '--wal-segsize', '1', '--allow-group-access' ])
+		if $oldver >= $ver_with_newopts;
+$newnode->init()
+		if $oldver < $ver_with_newopts;
 my $newbindir = $newnode->config_data('--bindir');
 my $oldbindir = $oldnode->config_data('--bindir');
 
