Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 76acd88

Browse files
committed
Stabilize tests.catchup.CatchupTest.test_tli_ptrack_catchup
1 parent 7feb748 commit 76acd88

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/catchup.py

+5
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,11 @@ def test_tli_ptrack_catchup(self):
357357
self.set_replica(dst_pg, src_pg) # fake replication
358358
src_pg.slow_start(replica = True)
359359
src_pg.promote()
360+
361+
src_pg.safe_psql("postgres", "CHECKPOINT") # force postgres to update tli in 'SELECT timeline_id FROM pg_catalog.pg_control_checkpoint()'
362+
src_tli = src_pg.safe_psql("postgres", "SELECT timeline_id FROM pg_catalog.pg_control_checkpoint()").decode('utf-8').rstrip()
363+
self.assertEqual(src_tli, "2", "Postgres didn't update TLI after promote")
364+
360365
src_pg.safe_psql("postgres", "CREATE TABLE ultimate_question AS SELECT 42 AS answer")
361366
src_query_result = src_pg.safe_psql("postgres", "SELECT * FROM ultimate_question")
362367

0 commit comments

Comments
 (0)