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

Commit26939d6

Browse files
author
Ivan Lazarev
committed
[PBCKP-220] removed inheritance GDBObj->ProbackupTest
1 parent32aae17 commit26939d6

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

‎tests/helpers/ptrack_helpers.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -810,8 +810,7 @@ def run_pb(self, command, asynchronous=False, gdb=False, old_binary=False, retur
810810
ifself.verbose:
811811
print(self.cmd)
812812
ifgdb:
813-
#TODO REVIEW XXX no self parameter
814-
returnGDBobj([binary_path]+command,self.verbose)
813+
returnGDBobj([binary_path]+command,self)
815814
ifasynchronous:
816815
returnsubprocess.Popen(
817816
[binary_path]+command,
@@ -1862,8 +1861,7 @@ def compare_pgdata(self, original_pgdata, restored_pgdata, exclusion_dict = dict
18621861
self.assertFalse(fail,error_message)
18631862

18641863
defgdb_attach(self,pid):
1865-
#TODO REVIEW XXX no self parameter
1866-
returnGDBobj([str(pid)],self.verbose,attach=True)
1864+
returnGDBobj([str(pid)],self,attach=True)
18671865

18681866
def_check_gdb_flag_or_skip_test(self):
18691867
ifnotself.gdb:
@@ -1872,24 +1870,28 @@ def _check_gdb_flag_or_skip_test(self):
18721870
"optimizations for run this test"
18731871
)
18741872

1873+
18751874
classGdbException(Exception):
1876-
def__init__(self,message=False):
1875+
def__init__(self,message="False"):
18771876
self.message=message
18781877

18791878
def__str__(self):
18801879
return'\n ERROR: {0}\n'.format(repr(self.message))
18811880

18821881

1883-
classGDBobj(ProbackupTest):
1884-
def__init__(self,cmd,verbose,attach=False):
1885-
self.verbose=verbose
1882+
#TODO REVIEW XXX no inheritance needed
1883+
# class GDBobj(ProbackupTest):
1884+
classGDBobj:
1885+
# TODO REVIEW XXX Type specification env:ProbackupTest is only for python3, is it ok?
1886+
def__init__(self,cmd,env:ProbackupTest,attach=False):
1887+
self.verbose=env.verbose
18861888
self.output=''
18871889

18881890
# Check gdb flag is set up
1889-
#if notself.gdb:
1890-
# raise GdbException("No `PGPROBACKUP_GDB=on` is set, "
1891-
# "test should call ProbackupTest::check_gdb_flag_or_skip_test() on its start "
1892-
# "and be skipped")
1891+
ifnotenv.gdb:
1892+
raiseGdbException("No `PGPROBACKUP_GDB=on` is set, "
1893+
"test should call ProbackupTest::check_gdb_flag_or_skip_test() on its start "
1894+
"and be skipped")
18931895
# Check gdb presense
18941896
try:
18951897
gdb_version,_=subprocess.Popen(

‎tests/replica.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,6 @@ def test_replica_stop_lsn_null_offset(self):
719719
deftest_replica_stop_lsn_null_offset_next_record(self):
720720
"""
721721
"""
722-
self._check_gdb_flag_or_skip_test()
723722

724723
fname=self.id().split('.')[3]
725724
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
@@ -743,7 +742,6 @@ def test_replica_stop_lsn_null_offset_next_record(self):
743742

744743
# freeze bgwriter to get rid of RUNNING XACTS records
745744
bgwriter_pid=master.auxiliary_pids[ProcessType.BackgroundWriter][0]
746-
gdb_checkpointer=self.gdb_attach(bgwriter_pid)
747745

748746
self.backup_node(backup_dir,'master',master)
749747

@@ -1097,7 +1095,6 @@ def test_replica_toast(self):
10971095
deftest_start_stop_lsn_in_the_same_segno(self):
10981096
"""
10991097
"""
1100-
self._check_gdb_flag_or_skip_test()
11011098

11021099
fname=self.id().split('.')[3]
11031100
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
@@ -1121,7 +1118,6 @@ def test_start_stop_lsn_in_the_same_segno(self):
11211118

11221119
# freeze bgwriter to get rid of RUNNING XACTS records
11231120
bgwriter_pid=master.auxiliary_pids[ProcessType.BackgroundWriter][0]
1124-
gdb_checkpointer=self.gdb_attach(bgwriter_pid)
11251121

11261122
self.backup_node(backup_dir,'master',master,options=['--stream'])
11271123

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp