From a1f62ffd18e9844b4b7a01946c5a870b5701d14f Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Fri, 8 Jul 2022 14:19:13 +0200 Subject: [PATCH] Add missing lock call for timeouts in waiter methods. --- testclient_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testclient_test.go b/testclient_test.go index beac45a..c54eb6d 100644 --- a/testclient_test.go +++ b/testclient_test.go @@ -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)