11import os
2+ import threading
23import unittest
34from .helpers .ptrack_helpers import ProbackupTest ,ProbackupException ,idx_ptrack
45from datetime import datetime ,timedelta
@@ -258,9 +259,12 @@ def test_replica_archive_page_backup(self):
258259
259260self .wait_until_replica_catch_with_master (master ,replica )
260261
262+ tm = threading .Timer (5 ,call_repeat , [1000 ,master .execute ,'select txid_current()' ])
263+ tm .start ()
261264backup_id = self .backup_node (
262265backup_dir ,'replica' ,replica ,
263266options = ['--archive-timeout=60' ])
267+ tm .join ()
264268
265269self .validate_pb (backup_dir ,'replica' )
266270self .assertEqual (
@@ -287,12 +291,12 @@ def test_replica_archive_page_backup(self):
287291master .pgbench_init (scale = 5 )
288292
289293pgbench = master .pgbench (
290- options = ['-T' ,'30 ' ,'-c' ,'2' ,'--no-vacuum' ])
294+ options = ['-T' ,'10 ' ,'-c' ,'2' ,'--no-vacuum' ])
291295
292296backup_id = self .backup_node (
293297backup_dir ,'replica' ,
294298replica ,backup_type = 'page' ,
295- options = ['--archive-timeout=60 ' ])
299+ options = ['--archive-timeout=10 ' ])
296300
297301pgbench .wait ()
298302
@@ -1555,6 +1559,9 @@ def test_replica_via_basebackup(self):
15551559self .set_auto_conf (node_restored , {'port' :node_restored .port })
15561560node_restored .slow_start (replica = True )
15571561
1562+ def call_repeat (times ,func ,* args ):
1563+ for i in range (times ):
1564+ func (* args )
15581565# TODO:
15591566# null offset STOP LSN and latest record in previous segment is conrecord (manual only)
15601567# archiving from promoted delayed replica