@@ -564,12 +564,13 @@ def get_control_data(self):
564
564
565
565
return out_dict
566
566
567
- def start (self , params = []):
567
+ def start (self , params = [], wait = True ):
568
568
"""
569
569
Start this node using pg_ctl.
570
570
571
571
Args:
572
572
params: additional arguments for pg_ctl.
573
+ wait: wait until operation completes
573
574
574
575
Returns:
575
576
This instance of :class:`.PostgresNode`.
@@ -579,7 +580,7 @@ def start(self, params=[]):
579
580
get_bin_path ("pg_ctl" ),
580
581
"-D" , self .data_dir ,
581
582
"-l" , self .pg_log_file ,
582
- "-w" , # wait
583
+ "-w" if wait else '-W' , # --wait or --no- wait
583
584
"start"
584
585
] + params # yapf: disable
585
586
@@ -594,12 +595,13 @@ def start(self, params=[]):
594
595
595
596
return self
596
597
597
- def stop (self , params = []):
598
+ def stop (self , params = [], wait = True ):
598
599
"""
599
600
Stop this node using pg_ctl.
600
601
601
602
Args:
602
603
params: additional arguments for pg_ctl.
604
+ wait: wait until operation completes
603
605
604
606
Returns:
605
607
This instance of :class:`.PostgresNode`.
@@ -608,7 +610,7 @@ def stop(self, params=[]):
608
610
_params = [
609
611
get_bin_path ("pg_ctl" ),
610
612
"-D" , self .data_dir ,
611
- "-w" , # wait
613
+ "-w" if wait else '-W' , # --wait or --no- wait
612
614
"stop"
613
615
] + params # yapf: disable
614
616
0 commit comments