Commit a029a064 authored by Tom Lane's avatar Tom Lane

Fix test case instability introduced in 085b6b66.

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.
parent b08dee24
......@@ -167,7 +167,8 @@ select count(*) > 0 as ok from (select * from pg_ls_waldir() limit 1) ss;
t
(1 row)
select (pg_ls_waldir()).size = :segsize as ok limit 1;
select (w).size = :segsize as ok
from (select pg_ls_waldir() w) ss where length((w).name) = 24 limit 1;
ok
----
t
......
......@@ -46,7 +46,8 @@ 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 = :segsize as ok limit 1;
select (w).size = :segsize as ok
from (select pg_ls_waldir() w) ss where length((w).name) = 24 limit 1;
select count(*) >= 0 as ok from pg_ls_archive_statusdir();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment