@@ -136,7 +136,7 @@ func NewEthClient(tc tests.TestContext, nodeURI tmpnet.NodeURI) ethclient.Client
136
136
func AddEphemeralNode (tc tests.TestContext , network * tmpnet.Network , node * tmpnet.Node ) * tmpnet.Node {
137
137
require := require .New (tc )
138
138
139
- require .NoError (network .StartNode (tc .DefaultContext (), tc . Log (), node ))
139
+ require .NoError (network .StartNode (tc .DefaultContext (), node ))
140
140
141
141
tc .DeferCleanup (func () {
142
142
tc .Log ().Info ("shutting down ephemeral node" ,
@@ -150,11 +150,11 @@ func AddEphemeralNode(tc tests.TestContext, network *tmpnet.Network, node *tmpne
150
150
}
151
151
152
152
// Wait for the given node to report healthy.
153
- func WaitForHealthy (t require. TestingT , node * tmpnet.Node ) {
153
+ func WaitForHealthy (tc tests. TestContext , node * tmpnet.Node ) {
154
154
// Need to use explicit context (vs DefaultContext()) to support use with DeferCleanup
155
155
ctx , cancel := context .WithTimeout (context .Background (), DefaultTimeout )
156
156
defer cancel ()
157
- require .NoError (t , tmpnet .WaitForHealthy (ctx , node ))
157
+ require .NoError (tc , tmpnet .WaitForHealthyNode (ctx , tc . Log () , node ))
158
158
}
159
159
160
160
// Sends an eth transaction and waits for the transaction receipt from the
@@ -236,7 +236,7 @@ func CheckBootstrapIsPossible(tc tests.TestContext, network *tmpnet.Network) *tm
236
236
}
237
237
238
238
node := tmpnet .NewEphemeralNode (flags )
239
- require .NoError (network .StartNode (tc .DefaultContext (), tc . Log (), node ))
239
+ require .NoError (network .StartNode (tc .DefaultContext (), node ))
240
240
// StartNode will initiate node stop if an error is encountered during start,
241
241
// so no further cleanup effort is required if an error is seen here.
242
242
@@ -248,7 +248,7 @@ func CheckBootstrapIsPossible(tc tests.TestContext, network *tmpnet.Network) *tm
248
248
})
249
249
250
250
// Check that the node becomes healthy within timeout
251
- require .NoError (tmpnet .WaitForHealthy (tc .DefaultContext (), node ))
251
+ require .NoError (tmpnet .WaitForHealthyNode (tc .DefaultContext (), tc . Log (), node ))
252
252
253
253
// Ensure that the primary validators are still healthy
254
254
for _ , node := range network .Nodes {
@@ -272,10 +272,11 @@ func StartNetwork(
272
272
networkCmd NetworkCmd ,
273
273
) {
274
274
require := require .New (tc )
275
+ log := tc .Log ()
275
276
276
277
err := tmpnet .BootstrapNewNetwork (
277
278
tc .DefaultContext (),
278
- tc . Log () ,
279
+ log ,
279
280
network ,
280
281
rootNetworkDir ,
281
282
)
@@ -289,7 +290,7 @@ func StartNetwork(
289
290
require .NoError (err , "failed to bootstrap network" )
290
291
}
291
292
292
- tc . Log () .Info ("network started successfully" )
293
+ log .Info ("network started successfully" )
293
294
294
295
symlinkPath , err := tmpnet .GetReusableNetworkPathForOwner (network .Owner )
295
296
require .NoError (err )
@@ -298,36 +299,36 @@ func StartNetwork(
298
299
// Symlink the path of the created network to the default owner path (e.g. latest_avalanchego-e2e)
299
300
// to enable easy discovery for reuse.
300
301
require .NoError (os .Symlink (network .Dir , symlinkPath ))
301
- tc . Log () .Info ("symlinked network dir for reuse" ,
302
+ log .Info ("symlinked network dir for reuse" ,
302
303
zap .String ("networkDir" , network .Dir ),
303
304
zap .String ("symlinkPath" , symlinkPath ),
304
305
)
305
306
}
306
307
307
308
tc .DeferCleanup (func () {
308
309
if networkCmd == ReuseNetworkCmd || networkCmd == RestartNetworkCmd {
309
- tc . Log () .Info ("skipping shutdown for network intended for reuse" ,
310
+ log .Info ("skipping shutdown for network intended for reuse" ,
310
311
zap .String ("networkDir" , network .Dir ),
311
312
zap .String ("symlinkPath" , symlinkPath ),
312
313
)
313
314
return
314
315
}
315
316
316
317
if networkCmd == StartNetworkCmd {
317
- tc . Log () .Info ("skipping shutdown for --start-network" ,
318
+ log .Info ("skipping shutdown for --start-network" ,
318
319
zap .String ("networkDir" , network .Dir ),
319
320
)
320
321
return
321
322
}
322
323
323
324
if shutdownDelay > 0 {
324
- tc . Log () .Info ("delaying network shutdown to ensure final metrics scrape" ,
325
+ log .Info ("delaying network shutdown to ensure final metrics scrape" ,
325
326
zap .Duration ("delay" , shutdownDelay ),
326
327
)
327
328
time .Sleep (shutdownDelay )
328
329
}
329
330
330
- tc . Log () .Info ("shutting down network" )
331
+ log .Info ("shutting down network" )
331
332
ctx , cancel := context .WithTimeout (context .Background (), DefaultTimeout )
332
333
defer cancel ()
333
334
require .NoError (network .Stop (ctx ))
0 commit comments