Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita9f0460

Browse files
committed
[Issue#449] fix tests
1 parent1825426 commita9f0460

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

‎tests/archive.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,16 @@ def test_archive_push_file_exists(self):
369369
self.add_instance(backup_dir,'node',node)
370370
self.set_archiving(backup_dir,'node',node)
371371

372-
wals_dir=os.path.join(backup_dir,'wal','node')
372+
wals_dir=os.path.join(backup_dir,'wal','node','00000000')
373373
ifself.archive_compress:
374374
filename='000000010000000000000001.gz'
375375
file=os.path.join(wals_dir,filename)
376376
else:
377377
filename='000000010000000000000001'
378378
file=os.path.join(wals_dir,filename)
379379

380+
os.makedirs(wals_dir)
381+
380382
withopen(file,'a+b')asf:
381383
f.write(b"blablablaadssaaaaaaaaaaaaaaa")
382384
f.flush()
@@ -469,6 +471,8 @@ def test_archive_push_file_exists_overwrite(self):
469471
filename='000000010000000000000001'
470472
file=os.path.join(wals_dir,filename)
471473

474+
os.makedirs(wals_dir)
475+
472476
withopen(file,'a+b')asf:
473477
f.write(b"blablablaadssaaaaaaaaaaaaaaa")
474478
f.flush()
@@ -565,14 +569,16 @@ def test_archive_push_partial_file_exists(self):
565569
filename_orig=filename_orig.decode('utf-8')
566570

567571
# form up path to next .part WAL segment
568-
wals_dir=os.path.join(backup_dir,'wal','node')
572+
wals_dir=os.path.join(backup_dir,'wal','node','00000000')
569573
ifself.archive_compress:
570574
filename=filename_orig+'.gz'+'.part'
571575
file=os.path.join(wals_dir,filename)
572576
else:
573577
filename=filename_orig+'.part'
574578
file=os.path.join(wals_dir,filename)
575579

580+
# os.makedirs(wals_dir)
581+
576582
# emulate stale .part file
577583
withopen(file,'a+b')asf:
578584
f.write(b"blahblah")
@@ -1111,6 +1117,7 @@ def test_archive_pg_receivexlog(self):
11111117
self.init_pb(backup_dir)
11121118
self.add_instance(backup_dir,'node',node)
11131119
node.slow_start()
1120+
11141121
ifself.get_version(node)<100000:
11151122
pg_receivexlog_path=self.get_bin_path('pg_receivexlog')
11161123
else:
@@ -1597,7 +1604,7 @@ def test_archive_catalog_1(self):
15971604
self.backup_node(backup_dir,'node',node)
15981605
node.pgbench_init(scale=2)
15991606

1600-
wals_dir=os.path.join(backup_dir,'wal','node')
1607+
wals_dir=os.path.join(backup_dir,'wal','node','00000000')
16011608
original_file=os.path.join(wals_dir,'000000010000000000000001.gz')
16021609
tmp_file=os.path.join(wals_dir,'000000010000000000000001')
16031610

@@ -1652,7 +1659,7 @@ def test_archive_catalog_2(self):
16521659
self.backup_node(backup_dir,'node',node)
16531660
node.pgbench_init(scale=2)
16541661

1655-
wals_dir=os.path.join(backup_dir,'wal','node')
1662+
wals_dir=os.path.join(backup_dir,'wal','node','00000000')
16561663
original_file=os.path.join(wals_dir,'000000010000000000000001.gz')
16571664
tmp_file=os.path.join(wals_dir,'000000010000000000000001')
16581665

@@ -2376,7 +2383,7 @@ def test_archive_get_prefetch_corruption(self):
23762383
sleep(20)
23772384

23782385
# now copy WAL files into prefetch directory and corrupt some of them
2379-
archive_dir=os.path.join(backup_dir,'wal','node')
2386+
archive_dir=os.path.join(backup_dir,'wal','node','00000000')
23802387
files=os.listdir(archive_dir)
23812388
files.sort()
23822389

@@ -2462,7 +2469,7 @@ def test_archive_show_partial_files_handling(self):
24622469

24632470
self.backup_node(backup_dir,'node',node)
24642471

2465-
wals_dir=os.path.join(backup_dir,'wal','node')
2472+
wals_dir=os.path.join(backup_dir,'wal','node','00000000')
24662473

24672474
# .part file
24682475
node.safe_psql(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp