@@ -264,10 +264,10 @@ func TestClusterMoveShard(t *testing.T) {
264264 col , err := db .CreateCollection (ctx , "test_move_shard" , & driver.CreateCollectionOptions {
265265 NumberOfShards : 12 ,
266266 })
267- defer clean (t , ctx , col )
268267 if err != nil {
269268 t .Fatalf ("CreateCollection failed: %s" , describe (err ))
270269 }
270+ defer clean (t , ctx , col )
271271 h , err := cl .Health (ctx )
272272 if err != nil {
273273 t .Fatalf ("Health failed: %s" , describe (err ))
@@ -365,10 +365,10 @@ func TestClusterResignLeadership(t *testing.T) {
365365 NumberOfShards : 12 ,
366366 ReplicationFactor : 2 ,
367367 })
368- defer clean (t , ctx , col )
369368 if err != nil {
370369 t .Fatalf ("CreateCollection failed: %s" , describe (err ))
371370 }
371+ defer clean (t , ctx , col )
372372 inv , err := cl .DatabaseInventory (ctx , db )
373373 if err != nil {
374374 t .Fatalf ("DatabaseInventory failed: %s" , describe (err ))
@@ -453,21 +453,21 @@ func TestClusterMoveShardWithViews(t *testing.T) {
453453 col , err := db .CreateCollection (ctx , "test_move_shard_with_view" , & driver.CreateCollectionOptions {
454454 NumberOfShards : 12 ,
455455 })
456- clean (t , ctx , col )
457456 if err != nil {
458457 t .Fatalf ("CreateCollection failed: %s" , describe (err ))
459458 }
459+ defer clean (t , ctx , col )
460460 opts := & driver.ArangoSearchViewProperties {
461461 Links : driver.ArangoSearchLinks {
462462 "test_move_shard_with_view" : driver.ArangoSearchElementProperties {},
463463 },
464464 }
465465 viewName := "test_move_shard_view"
466466 view , err := db .CreateArangoSearchView (ctx , viewName , opts )
467- clean (t , ctx , view )
468467 if err != nil {
469468 t .Fatalf ("Failed to create view '%s': %s" , viewName , describe (err ))
470469 }
470+ defer clean (t , ctx , view )
471471 h , err := cl .Health (ctx )
472472 if err != nil {
473473 t .Fatalf ("Health failed: %s" , describe (err ))
0 commit comments