From 5e65210cc42d6d60f3a336bfeb6b20c4e90df830 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 2 Nov 2023 13:53:44 +0000 Subject: [PATCH] Ensure invalidateTokenImmediately acquires mutex --- tests-integration/v3_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests-integration/v3_test.go b/tests-integration/v3_test.go index 38b3a60..ad3c0c6 100644 --- a/tests-integration/v3_test.go +++ b/tests-integration/v3_test.go @@ -99,8 +99,10 @@ func (s *testV2Server) addAccountWithDeviceID(userID, deviceID, token string) { // like invalidateToken, but doesn't do any waiting. func (s *testV2Server) invalidateTokenImmediately(token string) { + s.mu.Lock() delete(s.tokenToUser, token) delete(s.tokenToDevice, token) + s.mu.Unlock() } // remove the token and wait until the proxy sends a request with this token, then 401 it and return.