diff options
author | Noah Misch <noah@leadboat.com> | 2022-07-01 18:27:18 -0700 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2022-07-01 18:27:18 -0700 |
commit | 4f4c72c2dc06e944950305b0c1f48071ff49e263 (patch) | |
tree | f1676745bb45bc091a956cd637af08c3c872d66f /src | |
parent | f172b11d616e4e440be6b3235721e283e4c16460 (diff) | |
download | postgresql-4f4c72c2dc06e944950305b0c1f48071ff49e263.tar.gz postgresql-4f4c72c2dc06e944950305b0c1f48071ff49e263.zip |
Fix race condition in t/028_pitr_timelines.pl.
Per buildfarm members sungazer and mylodon. Back-patch to v15, which
introduced this test.
Discussion: https://postgr.es/m/20220627070457.GA2176699@rfd.leadboat.com
Diffstat (limited to 'src')
-rw-r--r-- | src/test/recovery/t/028_pitr_timelines.pl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/recovery/t/028_pitr_timelines.pl b/src/test/recovery/t/028_pitr_timelines.pl index a8b12d9af6e..bad02edf90a 100644 --- a/src/test/recovery/t/028_pitr_timelines.pl +++ b/src/test/recovery/t/028_pitr_timelines.pl @@ -140,6 +140,13 @@ is($result, qq{1}, "check table contents after point-in-time recovery"); # back to this timeline. $node_pitr->safe_psql('postgres', "INSERT INTO foo VALUES(3);"); +# Wait for the archiver to be running. The startup process might have yet to +# exit, in which case the postmaster has not started the archiver. If we +# stop() without an archiver, the archive will be incomplete. +$node_pitr->poll_query_until('postgres', + "SELECT true FROM pg_stat_activity WHERE backend_type = 'archiver';") + or die "Timed out while waiting for archiver to start"; + # Stop the node. This archives the last segment. $node_pitr->stop(); |