diff --git a/src/bin/pg_upgrade/t/002_pg_upgrade.pl b/src/bin/pg_upgrade/t/002_pg_upgrade.pl
index 311391d7acd..46203c55baf 100644
--- a/src/bin/pg_upgrade/t/002_pg_upgrade.pl
+++ b/src/bin/pg_upgrade/t/002_pg_upgrade.pl
@@ -221,6 +221,8 @@ push @old_initdb_params, '-k' if $oldnode->pg_version < 18;
 
 $old_node_params{extra} = \@old_initdb_params;
 $oldnode->init(%old_node_params);
+# Override log_statement set by Cluster.pm; undesirable for this test
+$oldnode->append_conf('postgresql.conf', 'log_statement = none');
 $oldnode->start;
 
 my $result;
@@ -312,6 +314,7 @@ push @new_initdb_params, ('--encoding', 'SQL_ASCII');
 push @new_initdb_params, ('--locale-provider', 'libc');
 $new_node_params{extra} = \@new_initdb_params;
 $newnode->init(%new_node_params);
+$newnode->append_conf('postgresql.conf', 'log_statement=none');	# see above
 
 # Stabilize stats for comparison.
 $newnode->append_conf('postgresql.conf', 'autovacuum = off');
@@ -379,6 +382,7 @@ SKIP:
 	# source cluster to avoid any differences between dumps taken from both the
 	# clusters caused by differences in their configurations.
 	$dstnode->init(%old_node_params);
+	$dstnode->append_conf('postgresql.conf', 'log_statement=none');
 	# Stabilize stats for comparison.
 	$dstnode->append_conf('postgresql.conf', 'autovacuum = off');
 	$dstnode->start;
