Further fix psql query-cancel test.
authorTom Lane <[email protected]>
Mon, 6 Sep 2021 20:14:49 +0000 (16:14 -0400)
committerTom Lane <[email protected]>
Mon, 6 Sep 2021 20:14:57 +0000 (16:14 -0400)
The query to wait for pg_sleep to be running did no such thing,
because the regex pattern it used could match itself.

Report: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=conchuela&dt=2021-09-06%2018%3A00%3A20

src/bin/psql/t/020_cancel.pl

index b3edaaf35d01656571180378a0c5fc45e1194a8f..0ca8e1743db6478b0163013eaf643b74ecd9c469 100644 (file)
@@ -53,7 +53,7 @@ SKIP: {
        # Send sleep command and wait until the server has registered it
        $stdin = "select pg_sleep(180);\n";
        pump $h while length $stdin;
-       $node->poll_query_until('postgres', q{SELECT (SELECT count(*) FROM pg_stat_activity WHERE query ~ 'pg_sleep') > 0;})
+       $node->poll_query_until('postgres', q{SELECT (SELECT count(*) FROM pg_stat_activity WHERE query ~ '^select pg_sleep') > 0;})
          or die "timed out";
 
        # Send cancel request