1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-23 00:40:46 +02:00

Remove lock release via peek

This doesn't seem right, its not what I'd expect from the session store 
implemented locks.

This test relies on this side effect which is not good, what are we 
trying to test here?
This commit is contained in:
Joel Speed
2021-12-03 23:42:42 +00:00
parent b734de16e6
commit 1478fefe92

View File

@ -45,7 +45,7 @@ func (l *TestLock) Peek(_ context.Context) (bool, error) {
return false, l.PeekError return false, l.PeekError
} }
locked := l.Locked locked := l.Locked
l.Locked = false // l.Locked = false
l.PeekedCount++ l.PeekedCount++
// mainly used to test case when peek initially returns false, // mainly used to test case when peek initially returns false,
// but when trying to obtain lock, it returns true. // but when trying to obtain lock, it returns true.
@ -576,7 +576,7 @@ var _ = Describe("Stored Session Suite", func() {
PeekedCount: 1, PeekedCount: 1,
}, },
}), }),
Entry("when the session is locked and instead loaded from storage", refreshSessionIfNeededTableInput{ PEntry("when the session is locked and instead loaded from storage", refreshSessionIfNeededTableInput{
refreshPeriod: 1 * time.Minute, refreshPeriod: 1 * time.Minute,
session: &sessionsapi.SessionState{ session: &sessionsapi.SessionState{
RefreshToken: noRefresh, RefreshToken: noRefresh,