Include Mutex for Hubs property (#13917)

Hubs property has been detected by the race condition detector
as a possible one because we could set the Hubs variable
and also we're spawning goroutines that could ask for that property

This condition is not happening right now because we're setting the
Hubs variable in the server start and after that, we're spawning the
goroutines but the tests are failing because of this and in the future
this could be a problem
Этот коммит содержится в:
Mario de Frutos Dieguez
2020-03-02 19:37:57 +01:00
коммит произвёл GitHub
родитель a981099652
Коммит 9742a0595d
3 изменённых файлов: 65 добавлений и 15 удалений

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

@@ -77,7 +77,7 @@ func TestHubStopRaceCondition(t *testing.T) {
wc1 := registerDummyWebConn(t, th.App, s.Listener.Addr(), th.BasicUser.Id)
defer wc1.Close()
hub := th.App.Srv().Hubs[0]
hub := th.App.Srv().GetHubs()[0]
th.App.HubStop()
time.Sleep(5 * time.Second)