From: Tom Lane Date: Wed, 11 Mar 2020 22:23:57 +0000 (-0400) Subject: Fix test case instability introduced in 085b6b667. X-Git-Tag: REL_10_13~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=064e029e60a516dea6566652d729419a51294ac2;p=thirdparty%2Fpostgresql.git Fix test case instability introduced in 085b6b667. I forgot that the WAL directory might hold other files besides WAL segments, notably including new segments still being filled. That means a blind test for the first file's size being 16MB can fail. Restrict based on file name length to make it more robust. Per buildfarm. --- diff --git a/src/test/regress/expected/misc_functions.out b/src/test/regress/expected/misc_functions.out index 8a23c4cc396..76b23049ea4 100644 --- a/src/test/regress/expected/misc_functions.out +++ b/src/test/regress/expected/misc_functions.out @@ -170,7 +170,8 @@ select count(*) > 0 as ok from (select * from pg_ls_waldir() limit 1) ss; t (1 row) -select (pg_ls_waldir()).size = :segbsize * :bsize as ok limit 1; +select (w).size = :segbsize * :bsize as ok +from (select pg_ls_waldir() w) ss where length((w).name) = 24 limit 1; ok ---- t diff --git a/src/test/regress/sql/misc_functions.sql b/src/test/regress/sql/misc_functions.sql index af834645c0c..cba43c553b9 100644 --- a/src/test/regress/sql/misc_functions.sql +++ b/src/test/regress/sql/misc_functions.sql @@ -49,4 +49,5 @@ select count(*) > 0 as ok from (select pg_ls_waldir()) ss; -- Test not-run-to-completion cases. select * from pg_ls_waldir() limit 0; select count(*) > 0 as ok from (select * from pg_ls_waldir() limit 1) ss; -select (pg_ls_waldir()).size = :segbsize * :bsize as ok limit 1; +select (w).size = :segbsize * :bsize as ok +from (select pg_ls_waldir() w) ss where length((w).name) = 24 limit 1;