Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a029a06

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 b08dee2 commit a029a06

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/test/regress/expected/misc_functions.out

+2-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ select count(*) > 0 as ok from (select * from pg_ls_waldir() limit 1) ss;
167167
t
168168
(1 row)
169169

170-
select (pg_ls_waldir()).size = :segsize as ok limit 1;
170+
select (w).size = :segsize as ok
171+
from (select pg_ls_waldir() w) ss where length((w).name) = 24 limit 1;
171172
ok
172173
----
173174
t

src/test/regress/sql/misc_functions.sql

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ select count(*) > 0 as ok from (select pg_ls_waldir()) ss;
4646
-- Test not-run-to-completion cases.
4747
select * from pg_ls_waldir() limit 0;
4848
select count(*) > 0 as ok from (select * from pg_ls_waldir() limit 1) ss;
49-
select (pg_ls_waldir()).size = :segsize as ok limit 1;
49+
select (w).size = :segsize as ok
50+
from (select pg_ls_waldir() w) ss where length((w).name) = 24 limit 1;
5051

5152
select count(*) >= 0 as ok from pg_ls_archive_statusdir();
5253

0 commit comments

Comments
 (0)