Fix race condition in telemetry (#18734)

* Fix race condition in telemetry

* Fix tests
Этот коммит содержится в:
Daniel Espino García
2021-10-20 09:58:25 +02:00
коммит произвёл GitHub
родитель c75058d4bc
Коммит 5928e4f9e0
5 изменённых файлов: 87 добавлений и 17 удалений

Просмотреть файл

@@ -127,11 +127,8 @@ func TestCORSRequestHandling(t *testing.T) {
*cfg.ServiceSettings.CorsAllowCredentials = testcase.CorsAllowCredentials
})
defer th.TearDown()
systemStore := mocks.SystemStore{}
systemStore.On("Get").Return(make(model.StringMap), nil)
licenseStore := mocks.LicenseStore{}
licenseStore.On("Get", "").Return(&model.LicenseRecord{}, nil)
th.App.Srv().Store.(*mocks.Store).On("System").Return(&systemStore)
th.App.Srv().Store.(*mocks.Store).On("License").Return(&licenseStore)
port := th.App.Srv().ListenAddr.Port