@@ -116,22 +116,6 @@ func (nodes Nodes) InitAndStartTest(ctx context.Context, t *testing.T,
116
116
t .FailNow ()
117
117
}
118
118
119
- // this is run sequentially since all nodes start almost at the same time
120
- // so waiting for one node will also wait for all the others.
121
- // You can see this since the test logs out that all the nodes are ready
122
- // at the same time.
123
- for _ , node := range nodes {
124
- err := waitForNode (ctx , node .RPCPort ())
125
- if err == nil {
126
- t .Logf ("Node %s is ready" , node )
127
- continue
128
- }
129
-
130
- t .Errorf ("Node %s failed to be ready: %s" , node , err )
131
- stopNodes (t , nodesCancel , runtimeErrors )
132
- t .FailNow ()
133
- }
134
-
135
119
// watch for runtime fatal error from any of the nodes
136
120
watchDogCtx , watchDogCancel := context .WithCancel (ctx )
137
121
watchDogDone := make (chan struct {})
@@ -159,6 +143,22 @@ func (nodes Nodes) InitAndStartTest(ctx context.Context, t *testing.T,
159
143
// Stop and wait for nodes to exit
160
144
stopNodes (t , nodesCancel , runtimeErrors )
161
145
})
146
+
147
+ // this is run sequentially since all nodes start almost at the same time
148
+ // so waiting for one node will also wait for all the others.
149
+ // You can see this since the test logs out that all the nodes are ready
150
+ // at the same time.
151
+ for _ , node := range nodes {
152
+ err := waitForNode (ctx , node .RPCPort ())
153
+ if err == nil {
154
+ t .Logf ("Node %s is ready" , node )
155
+ continue
156
+ }
157
+
158
+ t .Errorf ("Node %s failed to be ready: %s" , node , err )
159
+ stopNodes (t , nodesCancel , runtimeErrors )
160
+ t .FailNow ()
161
+ }
162
162
}
163
163
164
164
func stopNodes (t * testing.T , nodesCancel context.CancelFunc ,
0 commit comments