6
6
import subprocess
7
7
import gzip
8
8
import shutil
9
+ import time
9
10
10
11
class PageTest (ProbackupTest , unittest .TestCase ):
11
12
@@ -893,7 +894,7 @@ def test_page_backup_with_alien_wal_segment(self):
893
894
"create table t_heap as select i as id, "
894
895
"md5(i::text) as text, "
895
896
"md5(repeat(i::text,10))::tsvector as tsvector "
896
- "from generate_series(0,1000 ) i;" )
897
+ "from generate_series(0,10000 ) i;" )
897
898
898
899
alien_node .safe_psql (
899
900
"postgres" ,
@@ -905,7 +906,7 @@ def test_page_backup_with_alien_wal_segment(self):
905
906
"create table t_heap_alien as select i as id, "
906
907
"md5(i::text) as text, "
907
908
"md5(repeat(i::text,10))::tsvector as tsvector "
908
- "from generate_series(0,100000 ) i;" )
909
+ "from generate_series(0,10000 ) i;" )
909
910
910
911
# copy latest wal segment
911
912
wals_dir = os .path .join (backup_dir , 'wal' , 'alien_node' )
@@ -916,9 +917,9 @@ def test_page_backup_with_alien_wal_segment(self):
916
917
file = os .path .join (wals_dir , filename )
917
918
file_destination = os .path .join (
918
919
os .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 )
922
923
os .remove (file_destination )
923
924
os .rename (file , file_destination )
924
925
0 commit comments