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
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a981099652
Коммит
9742a0595d
@@ -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)
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user