mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Don't faff about with waiting
This commit is contained in:
parent
e67a945a5e
commit
eb4c152952
@ -452,7 +452,7 @@ func TestPollerExpiryEnsurePollingRace(t *testing.T) {
|
||||
}
|
||||
// Expire the token before we process the request.
|
||||
t.Log("Alice's token expires.")
|
||||
v2.invalidateToken(token)
|
||||
v2.invalidateTokenImmediately(token)
|
||||
})
|
||||
|
||||
v3.mustDoV3Request(t, aliceToken, sync3.Request{})
|
||||
|
@ -97,6 +97,12 @@ func (s *testV2Server) addAccountWithDeviceID(userID, deviceID, token string) {
|
||||
}
|
||||
}
|
||||
|
||||
// like invalidateToken, but doesn't do any waiting.
|
||||
func (s *testV2Server) invalidateTokenImmediately(token string) {
|
||||
delete(s.tokenToUser, token)
|
||||
delete(s.tokenToDevice, token)
|
||||
}
|
||||
|
||||
// remove the token and wait until the proxy sends a request with this token, then 401 it and return.
|
||||
func (s *testV2Server) invalidateToken(token string) {
|
||||
var wg sync.WaitGroup
|
||||
|
Loading…
x
Reference in New Issue
Block a user