Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9e44d50

Browse files
committed
tests: changes to tests.README and minor corrections
1 parent e1e6281 commit 9e44d50

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

tests/Readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Check archive compression:
1515
1616
Usage:
1717
pip install testgres==0.4.0
18+
pip install psycopg2
1819
export PG_CONFIG=/path/to/pg_config
1920
python -m unittest [-v] tests[.specific_module][.class.test]
2021
```

tests/backup_test.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,13 @@ def test_checksumm_fail_heal_via_ptrack_fail(self):
403403
self.assertTrue(
404404
"WARNING: File" in e.message and
405405
"blknum" in e.message and
406-
"have wrong checksum" in e.message,
406+
"have wrong checksum" in e.message and
407+
"try to fetch via SQL" in e.message and
408+
"WARNING: page verification failed, "
409+
"calculated checksum" in e.message and
410+
"ERROR: query failed: "
411+
"ERROR: invalid page in block" in e.message and
412+
"query was: SELECT pg_ptrack_get_block_2" in e.message,
407413
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
408414
repr(e.message), self.cmd))
409415

tests/ptrack_clean.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ class SimpleTest(ProbackupTest, unittest.TestCase):
1313
def test_ptrack_clean(self):
1414
"""Take backups of every available types and check that PTRACK is clean"""
1515
fname = self.id().split('.')[3]
16-
node = self.make_simple_node(base_dir="{0}/{1}/node".format(module_name, fname),
16+
node = self.make_simple_node(
17+
base_dir="{0}/{1}/node".format(module_name, fname),
1718
set_replication=True,
1819
initdb_params=['--data-checksums'],
19-
pg_options={'ptrack_enable': 'on', 'wal_level': 'replica', 'max_wal_senders': '2'})
20+
pg_options={
21+
'ptrack_enable': 'on',
22+
'wal_level': 'replica',
23+
'max_wal_senders': '2'})
2024
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
2125
self.init_pb(backup_dir)
2226
self.add_instance(backup_dir, 'node', node)
@@ -53,7 +57,9 @@ def test_ptrack_clean(self):
5357
node.safe_psql('postgres', 'vacuum t_heap')
5458

5559
# Take PTRACK backup to clean every ptrack
56-
backup_id = self.backup_node(backup_dir, 'node', node, backup_type='ptrack', options=['-j100'])
60+
backup_id = self.backup_node(
61+
backup_dir, 'node', node, backup_type='ptrack',
62+
options=['-j100', '--log-level-file=verbose'])
5763
node.safe_psql('postgres', 'checkpoint')
5864

5965
for i in idx_ptrack:

tests/validate_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,8 @@ def test_validate_wal_lost_segment_1(self):
967967
# Delete wal segment
968968
wals_dir = os.path.join(backup_dir, 'wal', 'node')
969969
wals = [f for f in os.listdir(wals_dir) if os.path.isfile(os.path.join(wals_dir, f)) and not f.endswith('.backup')]
970-
file = os.path.join(backup_dir, 'wal', 'node', wals[1])
970+
wals.sort()
971+
file = os.path.join(backup_dir, 'wal', 'node', wals[3])
971972
os.remove(file)
972973

973974
# cut out '.gz'

0 commit comments

Comments
 (0)