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
This commit is contained in:
Noah Misch 2022-07-01 18:27:18 -07:00
parent f172b11d61
commit 4f4c72c2dc
1 changed files with 7 additions and 0 deletions

View File

@ -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();