66import subprocess
77import gzip
88import shutil
9+ import time
910
1011class PageTest (ProbackupTest ,unittest .TestCase ):
1112
@@ -893,7 +894,7 @@ def test_page_backup_with_alien_wal_segment(self):
893894"create table t_heap as select i as id, "
894895"md5(i::text) as text, "
895896"md5(repeat(i::text,10))::tsvector as tsvector "
896- "from generate_series(0,1000 ) i;" )
897+ "from generate_series(0,10000 ) i;" )
897898
898899alien_node .safe_psql (
899900"postgres" ,
@@ -905,7 +906,7 @@ def test_page_backup_with_alien_wal_segment(self):
905906"create table t_heap_alien as select i as id, "
906907"md5(i::text) as text, "
907908"md5(repeat(i::text,10))::tsvector as tsvector "
908- "from generate_series(0,100000 ) i;" )
909+ "from generate_series(0,10000 ) i;" )
909910
910911# copy latest wal segment
911912wals_dir = os .path .join (backup_dir ,'wal' ,'alien_node' )
@@ -916,9 +917,9 @@ def test_page_backup_with_alien_wal_segment(self):
916917file = os .path .join (wals_dir ,filename )
917918file_destination = os .path .join (
918919os .path .join (backup_dir ,'wal' ,'node' ),filename )
919- # file =os.path.join(wals_dir, '000000010000000000000004' )
920- print ( file )
921- print ( file_destination )
920+ start = time . time ( )
921+ while not os . path . exists ( file_destination ) and time . time () - start < 20 :
922+ time . sleep ( 0.1 )
922923os .remove (file_destination )
923924os .rename (file ,file_destination )
924925