Skip to content

Commit

Permalink
Fixed racy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michelvocks committed Jun 25, 2019
1 parent 376c8ca commit 78c33fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions handlers/workers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 78c33fa

Please sign in to comment.