Add missing lock call for timeouts in waiter methods.

This commit is contained in:
Joachim Bauch 2022-07-08 14:19:13 +02:00
parent 6e9a36a434
commit a1f62ffd18
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02

View file

@ -315,6 +315,7 @@ func (c *TestClient) WaitForClientRemoved(ctx context.Context) error {
c.hub.mu.Unlock()
select {
case <-ctx.Done():
c.hub.mu.Lock()
return ctx.Err()
default:
time.Sleep(time.Millisecond)
@ -341,6 +342,7 @@ func (c *TestClient) WaitForSessionRemoved(ctx context.Context, sessionId string
c.hub.mu.Unlock()
select {
case <-ctx.Done():
c.hub.mu.Lock()
return ctx.Err()
default:
time.Sleep(time.Millisecond)