1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-03-20 21:38:44 +02:00

tests: test_locking_simple_2() added

This commit is contained in:
Grigory Smolkin 2019-01-31 18:57:28 +03:00
parent 50f5e5013a
commit 2c08cb2c2f

View File

@ -11,7 +11,7 @@ class LockingTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
# @unittest.expectedFailure
def test_locking_simple(self):
def test_locking_simple_1(self):
""""""
fname = self.id().split('.')[3]
node = self.make_simple_node(
@ -36,8 +36,6 @@ class LockingTest(ProbackupTest, unittest.TestCase):
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
self.AssertTrue(False, 'Failed to hit breakpoint')
gdb._execute('signal SIGKILL')
self.validate_pb(backup_dir)
self.assertEqual(
@ -46,5 +44,35 @@ class LockingTest(ProbackupTest, unittest.TestCase):
self.assertEqual(
'ERROR', self.show_pb(backup_dir, 'node')[1]['status'])
# Clean after yourself
self.del_test_dir(module_name, fname)
def test_locking_simple_2(self):
""""""
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
initdb_params=['--data-checksums'],
pg_options={'wal_level': 'replica'})
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
self.init_pb(backup_dir)
self.add_instance(backup_dir, 'node', node)
self.set_archiving(backup_dir, 'node', node)
node.slow_start()
self.backup_node(backup_dir, 'node', node)
gdb = self.backup_node(
backup_dir, 'node', node, gdb=True)
gdb.set_breakpoint('copy_file')
gdb.run_until_break()
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
self.AssertTrue(False, 'Failed to hit breakpoint')
self.validate_pb(backup_dir)
# Clean after yourself
self.del_test_dir(module_name, fname)