summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane2026-09-02 14:53:35 +0000
committerTom Lane2026-09-02 14:53:35 +0000
commitb51dd2b2c5a390dca8868675d7f01d8d3874cd7b (patch)
tree0f899b96ea4cfa1c53c08929eeb29c8ffb415dc3 /src
parentdd7c135bb97ec7a5dad09fa9e1e2dd9c044ceee8 (diff)
Stabilize xid_wraparound/t/002_limits.pl test.
Not many buildfarm members run this test, since it's gated behind PG_TEST_EXTRA=xid_wraparound, but of those that do, the slower ones not infrequently fail. The reason seems to be that the test expects an INSERT command to either succeed or fail, but there's a window where it can succeed while issuing a warning about impending wraparound. poll_query_until treats nonempty stderr as a failure, so it loops an extra time until the INSERT succeeds with no warning. There seems no reason to treat this behavior as wrong, so adjust the test to accept it. Reported-by: Alexander Lakhin <exclusion@gmail.com> Diagnosed-by: Alexander Lakhin <exclusion@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/7a68bee2-91bd-481d-be44-160e6beebc83@gmail.com Backpatch-through: 17
Diffstat (limited to 'src')
-rw-r--r--src/test/modules/xid_wraparound/t/002_limits.pl13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/test/modules/xid_wraparound/t/002_limits.pl b/src/test/modules/xid_wraparound/t/002_limits.pl
index aa1d8765d3a..4cd6579c13d 100644
--- a/src/test/modules/xid_wraparound/t/002_limits.pl
+++ b/src/test/modules/xid_wraparound/t/002_limits.pl
@@ -125,14 +125,19 @@ $ret =
qq[INSERT INTO wraparoundtest VALUES ('after VACUUM')],
'INSERT 0 1');
-# Check the table contents
+# Check the table contents. It's possible for more than one "after VACUUM"
+# entry to appear, because there is a window where the preceding INSERT will
+# succeed but also produce a warning message about impending wraparound.
+# poll_query_until won't accept that as a successful result, so it iterates
+# an additional time or times until the INSERT succeeds cleanly.
$ret = $node->safe_psql('postgres', qq[SELECT * from wraparoundtest]);
-is( $ret, "start
+like(
+ $ret, qr/^start
oldxact
after 1 billion
after 2 billion
-reached warn-limit
-after VACUUM");
+reached warn-limit(
+after VACUUM)+$/);
$node->stop;
done_testing();