diff --git a/src/test/recovery/t/007_sync_rep.pl b/src/test/recovery/t/007_sync_rep.pl
index a84022112b1c532fe4ac04016b6708ca2a731fdf..eccde8f551f059f66839ff1072c8d6cad044f1d9 100644
--- a/src/test/recovery/t/007_sync_rep.pl
+++ b/src/test/recovery/t/007_sync_rep.pl
@@ -42,6 +42,7 @@ sub start_standby_and_wait
 
 	print("### Waiting for standby \"$standby_name\" on \"$master_name\"\n");
 	$master->poll_query_until('postgres', $query);
+	return;
 }
 
 # Initialize master node