Skip to content

Commit 064e029

Browse files
committed
Fix test case instability introduced in 085b6b6.
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.
1 parent d04e342 commit 064e029

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/test/regress/expected/misc_functions.out

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ select count(*) > 0 as ok from (select * from pg_ls_waldir() limit 1) ss;
170170
t
171171
(1 row)
172172

173-
select (pg_ls_waldir()).size = :segbsize * :bsize as ok limit 1;
173+
select (w).size = :segbsize * :bsize as ok
174+
from (select pg_ls_waldir() w) ss where length((w).name) = 24 limit 1;
174175
ok
175176
----
176177
t

src/test/regress/sql/misc_functions.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,5 @@ select count(*) > 0 as ok from (select pg_ls_waldir()) ss;
4949
-- Test not-run-to-completion cases.
5050
select * from pg_ls_waldir() limit 0;
5151
select count(*) > 0 as ok from (select * from pg_ls_waldir() limit 1) ss;
52-
select (pg_ls_waldir()).size = :segbsize * :bsize as ok limit 1;
52+
select (w).size = :segbsize * :bsize as ok
53+
from (select pg_ls_waldir() w) ss where length((w).name) = 24 limit 1;

0 commit comments

Comments
 (0)