From: Tom Lane Date: Fri, 2 Dec 2016 22:23:54 +0000 (-0500) Subject: Fix broken wait-for-previous-process-to-exit loop in regression test. X-Git-Tag: REL_10_BETA1~1321 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19fcc0058ecc8e5eb756547006bc1b24a93cbb80;p=postgresql Fix broken wait-for-previous-process-to-exit loop in regression test. Must do pg_stat_clear_snapshot() inside test's loop, or our snapshot of pg_stat_activity will never change :-(. Thinko in b3427dade -- evidently my workstation never really iterated the loop in testing. Per buildfarm. --- diff --git a/src/test/modules/test_extensions/expected/test_extensions.out b/src/test/modules/test_extensions/expected/test_extensions.out index a24820e735..ba8b90e742 100644 --- a/src/test/modules/test_extensions/expected/test_extensions.out +++ b/src/test/modules/test_extensions/expected/test_extensions.out @@ -106,7 +106,7 @@ do 'declare c int = 0; begin while (select count(*) from pg_stat_activity where pid = ' :'oldpid' - ') > 0 loop c := c + 1; end loop; + ') > 0 loop c := c + 1; perform pg_stat_clear_snapshot(); end loop; raise log ''test_extensions looped % times'', c; end'; -- extension should now contain no temp objects diff --git a/src/test/modules/test_extensions/sql/test_extensions.sql b/src/test/modules/test_extensions/sql/test_extensions.sql index 5e884d187f..0bfc559295 100644 --- a/src/test/modules/test_extensions/sql/test_extensions.sql +++ b/src/test/modules/test_extensions/sql/test_extensions.sql @@ -55,7 +55,7 @@ do 'declare c int = 0; begin while (select count(*) from pg_stat_activity where pid = ' :'oldpid' - ') > 0 loop c := c + 1; end loop; + ') > 0 loop c := c + 1; perform pg_stat_clear_snapshot(); end loop; raise log ''test_extensions looped % times'', c; end';