diff --git a/src/test/recovery/t/049_wait_for_lsn.pl b/src/test/recovery/t/049_wait_for_lsn.pl
index bf61b8c4..ca07873e 100644
--- a/src/test/recovery/t/049_wait_for_lsn.pl
+++ b/src/test/recovery/t/049_wait_for_lsn.pl
@@ -216,7 +216,7 @@ $node_standby->psql(
 	"SELECT pg_wal_replay_wait_wrap('${lsn3}');",
 	stderr => \$stderr);
 ok( $stderr =~
-	  /WAIT FOR must be called without an active or registered snapshot/,
+	  /WAIT FOR cannot be executed from a function or procedure/,
 	"get an error when running within another function");
 
 # 6. Check parameter validation error cases on standby before promotion
