Skip to content

Commit 0123fed

Browse files
committed
chore: Closing in goroutine causes race with logging framework
1 parent 4ae412b commit 0123fed

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

task/backend/analytical_storage_test.go

+11-13
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,22 @@ func TestAnalyticalStore(t *testing.T) {
6666

6767
ts.BucketService = storage.NewBucketService(ts.BucketService, ab.storageEngine)
6868

69-
go func() {
70-
<-ctx.Done()
71-
ab.Close(t)
72-
}()
73-
7469
authCtx := icontext.SetAuthorizer(ctx, &influxdb.Authorization{
7570
Permissions: influxdb.OperPermissions(),
7671
})
7772

7873
return &servicetest.System{
79-
TaskControlService: svcStack,
80-
TaskService: svcStack,
81-
OrganizationService: ts.OrganizationService,
82-
UserService: ts.UserService,
83-
UserResourceMappingService: ts.UserResourceMappingService,
84-
AuthorizationService: authSvc,
85-
Ctx: authCtx,
86-
}, cancelFunc
74+
TaskControlService: svcStack,
75+
TaskService: svcStack,
76+
OrganizationService: ts.OrganizationService,
77+
UserService: ts.UserService,
78+
UserResourceMappingService: ts.UserResourceMappingService,
79+
AuthorizationService: authSvc,
80+
Ctx: authCtx,
81+
}, func() {
82+
cancelFunc()
83+
ab.Close(t)
84+
}
8785
},
8886
)
8987
}

0 commit comments

Comments
 (0)