diff --git a/src/test/recovery/t/040_standby_failover_slots_sync.pl b/src/test/recovery/t/040_standby_failover_slots_sync.pl
index 825c26da6f..60f39cd2e3 100644
--- a/src/test/recovery/t/040_standby_failover_slots_sync.pl
+++ b/src/test/recovery/t/040_standby_failover_slots_sync.pl
@@ -14,7 +14,11 @@ use Test::More;
 
 # Create publisher
 my $publisher = PostgreSQL::Test::Cluster->new('publisher');
-$publisher->init(allows_streaming => 'logical');
+# A specific role is created to perform some tests related to slot
+# synchronization, and it needs proper authentication configuration.
+$publisher->init(
+	allows_streaming => 'logical',
+	auth_extra => [ '--create-role', 'repl_role' ]);
 # Disable autovacuum to avoid generating xid during stats update as otherwise
 # the new XID could then be replicated to standby at some random point making
 # slots at primary lag behind standby during slot sync.
