Skip to content

Commit 9652bb9

Browse files
committed
Fix test for wait option
1 parent 404acfb commit 9652bb9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Diff for: testgres/node.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ def start(self, params=[], wait=True):
570570
571571
Args:
572572
params: additional arguments for pg_ctl.
573-
wait: wait until operation completes
573+
wait: wait until operation completes.
574574
575575
Returns:
576576
This instance of :class:`.PostgresNode`.
@@ -601,7 +601,7 @@ def stop(self, params=[], wait=True):
601601
602602
Args:
603603
params: additional arguments for pg_ctl.
604-
wait: wait until operation completes
604+
wait: wait until operation completes.
605605
606606
Returns:
607607
This instance of :class:`.PostgresNode`.

Diff for: tests/test_simple.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,15 @@ def test_backup_wrong_xlog_method(self):
376376
def test_pg_ctl_wait_option(self):
377377
with get_new_node() as node:
378378
node.init().start(wait=False)
379-
node.stop(wait=False)
379+
while True:
380+
try:
381+
node.stop(wait=False)
382+
except ExecUtilException:
383+
# it's ok to break here since node could be not
384+
# started yet
385+
continue
386+
else:
387+
break
380388

381389
def test_replicate(self):
382390
with get_new_node() as node:

0 commit comments

Comments
 (0)