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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy