mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-05 20:32:57 +02:00
bug: fix potential race condition in unit test
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
1fa45c6ec2
commit
8bd79903db
2 changed files with 24 additions and 6 deletions
|
@ -122,7 +122,7 @@ func TestSignedRedirectURL(t *testing.T) {
|
|||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
testTimeNow = tt.mockedTime
|
||||
mockNow.setNow(tt.mockedTime)
|
||||
got := SignedRedirectURL(tt.key, tt.destination, tt.urlToSign)
|
||||
if diff := cmp.Diff(got, tt.want); diff != "" {
|
||||
t.Errorf("SignedRedirectURL() = diff %v", diff)
|
||||
|
@ -142,7 +142,7 @@ func Test_timestamp(t *testing.T) {
|
|||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
testTimeNow = tt.dontWant
|
||||
mockNow.setNow(tt.dontWant)
|
||||
if got := timestamp(); got == tt.dontWant {
|
||||
t.Errorf("timestamp() = %v, dontWant %v", got, tt.dontWant)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue