Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 152faf3

Browse files
committed
Add instance names for 9.6 and 10
1 parent 1bd538f commit 152faf3

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

testgres/node.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def get_auxiliary_pids(self):
479479

480480
result = {}
481481
for child in children:
482-
line = child.cmdline()[0]
482+
line = ' '.join(child.cmdline())
483483
for ptype in ProcessType:
484484
if ptype == ProcessType.WalSender \
485485
and (line.startswith(ptype.value) or
@@ -513,8 +513,10 @@ def get_walsender_pid(self):
513513
for name, client_port in self._master.execute(sql):
514514
if name == self.name:
515515
for child in children:
516-
line = child.cmdline()[0]
517-
if line.startswith('postgres: walsender') and str(client_port) in line:
516+
line = ' '.join(child.cmdline())
517+
if (line.startswith(ProcessType.WalSender.value) or
518+
line.startswith('postgres: wal sender')) and \
519+
str(client_port) in line:
518520
return child.pid
519521

520522
return None

tests/test_simple.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -709,15 +709,17 @@ def test_pids(self):
709709
except ImportError:
710710
psutil = None
711711

712-
master_processes = (
712+
master_processes = [
713713
ProcessType.Checkpointer,
714714
ProcessType.BackgroundWriter,
715715
ProcessType.WalWriter,
716716
ProcessType.AutovacuumLauncher,
717717
ProcessType.StatsCollector,
718-
ProcessType.LogicalReplicationLauncher,
719718
ProcessType.WalSender,
720-
)
719+
]
720+
if pg_version_ge('10'):
721+
master_processes.append(ProcessType.LogicalReplicationLauncher)
722+
721723
repl_processes = (
722724
ProcessType.Startup,
723725
ProcessType.Checkpointer,

0 commit comments

Comments
 (0)