@@ -53,10 +53,11 @@ def test_custom_init(self):
53
53
54
54
def test_double_init (self ):
55
55
with get_new_node ('test' ) as node :
56
+ node .init ()
57
+
56
58
# can't initialize node more than once
57
59
with self .assertRaises (InitNodeException ):
58
60
node .init ()
59
- node .init ()
60
61
61
62
def test_init_after_cleanup (self ):
62
63
with get_new_node ('test' ) as node :
@@ -70,6 +71,14 @@ def test_init_after_cleanup(self):
70
71
node .status ()
71
72
node .safe_psql ('postgres' , 'select 1' )
72
73
74
+ def test_double_start (self ):
75
+ with get_new_node ('test' ) as node :
76
+ node .init ().start ()
77
+
78
+ # can't start node more than once
79
+ with self .assertRaises (StartNodeException ):
80
+ node .start ()
81
+
73
82
def test_uninitialized_start (self ):
74
83
with get_new_node ('test' ) as node :
75
84
# node is not initialized yet
@@ -119,22 +128,13 @@ def test_psql(self):
119
128
120
129
def test_status (self ):
121
130
# check NodeStatus cast to bool
122
- condition_triggered = False
123
- if NodeStatus .Running :
124
- condition_triggered = True
125
- self .assertTrue (condition_triggered )
131
+ self .assertTrue (NodeStatus .Running )
126
132
127
133
# check NodeStatus cast to bool
128
- condition_triggered = False
129
- if NodeStatus .Stopped :
130
- condition_triggered = True
131
- self .assertFalse (condition_triggered )
134
+ self .assertFalse (NodeStatus .Stopped )
132
135
133
136
# check NodeStatus cast to bool
134
- condition_triggered = False
135
- if NodeStatus .Uninitialized :
136
- condition_triggered = True
137
- self .assertFalse (condition_triggered )
137
+ self .assertFalse (NodeStatus .Uninitialized )
138
138
139
139
# check statuses after each operation
140
140
with get_new_node ('test' ) as node :
@@ -426,6 +426,10 @@ def test_logging(self):
426
426
lines = log .readlines ()
427
427
self .assertTrue (any (node_name in s for s in lines ))
428
428
429
+ # test logger after restart
430
+ master .restart ()
431
+ self .assertTrue (master ._logger .is_alive ())
432
+
429
433
def test_pgbench (self ):
430
434
with get_new_node ('node' ) as node :
431
435
node .init ().start ().pgbench_init ()
0 commit comments