diff --git a/src/test/recovery/RecoveryTest.pm b/src/test/recovery/RecoveryTest.pm
index c015f3b..5cc977d 100644
--- a/src/test/recovery/RecoveryTest.pm
+++ b/src/test/recovery/RecoveryTest.pm
@@ -11,7 +11,7 @@ package RecoveryTest;
 # It is then up to the test to decide what to do with the newly-created
 # node.
 #
-# Environmenment configuration of each node is available through a set
+# Environment configuration of each node is available through a set
 # of global variables provided by this package, hashed depending on the
 # port number of a node:
 # - connstr_nodes connection string to connect to this node
diff --git a/src/test/recovery/t/001_stream_rep.pl b/src/test/recovery/t/001_stream_rep.pl
index 757a639..2c59b73 100644
--- a/src/test/recovery/t/001_stream_rep.pl
+++ b/src/test/recovery/t/001_stream_rep.pl
@@ -31,9 +31,9 @@ psql $connstr_nodes{ $port_master },
 my $current_lsn = psql $connstr_nodes{ $port_master },
 	"SELECT pg_current_xlog_location();";
 my $caughtup_query = "SELECT '$current_lsn'::pg_lsn <= replay_location FROM pg_stat_replication";
-poll_query_until($caughtup_query, $connstr_nodes{ $port_master })
-	or die "Timed out while waiting for standby 1 to catch up";
 poll_query_until($caughtup_query, $connstr_nodes{ $port_standby_1 })
+	or die "Timed out while waiting for standby 1 to catch up";
+poll_query_until($caughtup_query, $connstr_nodes{ $port_standby_2 })
 	or die "Timed out while waiting for standby 2 to catch up";

 my $result = psql $connstr_nodes{ $port_standby_1 },
--
2.4.3

