From 78c33fadc014d25be7429a177c324a65b4fd9a68 Mon Sep 17 00:00:00 2001 From: Michel Vocks Date: Tue, 25 Jun 2019 10:53:58 +0200 Subject: [PATCH] Fixed racy tests --- handlers/workers_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/handlers/workers_test.go b/handlers/workers_test.go index 3d4bb67b..cd8f6deb 100644 --- a/handlers/workers_test.go +++ b/handlers/workers_test.go @@ -50,6 +50,7 @@ func TestRegisterWorker(t *testing.T) { m := &mockStorageService{} services.MockStorageService(m) dataStore, _ := services.StorageService() + defer func() { services.MockStorageService(nil) }() // Initialize certificate store _, err = services.CertificateService() @@ -189,6 +190,7 @@ func TestDeregisterWorker(t *testing.T) { m := &mockStorageService{} services.MockStorageService(m) dataStore, _ := services.StorageService() + defer func() { services.MockStorageService(nil) }() // Initialize certificate store _, err = services.CertificateService() @@ -380,6 +382,7 @@ func TestGetWorkerStatusOverview(t *testing.T) { m := &mockStorageService{} services.MockStorageService(m) dataStore, _ := services.StorageService() + defer func() { services.MockStorageService(nil) }() // Initialize certificate store _, err = services.CertificateService() @@ -531,6 +534,7 @@ func TestGetWorker(t *testing.T) { m := &mockStorageService{} services.MockStorageService(m) dataStore, _ := services.StorageService() + defer func() { services.MockStorageService(nil) }() // Initialize certificate store _, err = services.CertificateService()