File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -198,11 +198,6 @@ impl TestContext {
198
198
}
199
199
}
200
200
201
- lazy_static ! {
202
- static ref NETWORKS : Arc <Mutex <HashMap <String , TestNetwork >>> =
203
- Arc :: new( Mutex :: new( HashMap :: new( ) ) ) ;
204
- }
205
-
206
201
// TestNetwork creates a testnetwork in central and joins it. When this data is destroyed/dropped
207
202
// it will remove the network and leave it like nothing ever happened.
208
203
#[ derive( Clone ) ]
@@ -303,16 +298,13 @@ impl TestNetwork {
303
298
}
304
299
305
300
pub fn teardown ( & mut self ) {
306
- let identity = self . identity ( ) ;
307
301
tokio:: task:: block_in_place ( move || {
308
302
tokio:: runtime:: Handle :: current ( ) . block_on ( async {
309
- if let Some ( network) = NETWORKS . lock ( ) . await . remove ( & identity) {
310
- network. leave ( ) . await . unwrap ( ) ;
311
- let central = network. central ( ) ;
312
- zerotier_central_api:: apis:: network_api:: delete_network ( & central, & identity)
313
- . await
314
- . unwrap ( ) ;
315
- }
303
+ self . leave ( ) . await . unwrap ( ) ;
304
+ let central = self . central ( ) ;
305
+ zerotier_central_api:: apis:: network_api:: delete_network ( & central, & self . identity ( ) )
306
+ . await
307
+ . unwrap_err ( ) ;
316
308
} )
317
309
} )
318
310
}
You can’t perform that action at this time.
0 commit comments