test: quick fix flaky test

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
This commit is contained in:
Mark Sagi-Kazar 2021-06-28 23:30:14 +02:00
parent e1ae7240f4
commit ceb4324c18
No known key found for this signature in database
GPG Key ID: 31AB0439F4C5C90E
1 changed files with 2 additions and 1 deletions

View File

@ -317,7 +317,8 @@ func makeOAuth2Tests(clientID string, clientSecret string, now func() time.Time)
return t1.Sub(t2) < within
}
if !timeEq(token.Expiry, expectedExpiry, time.Second) {
// TODO: This is a flaky test. We need something better (eg. clockwork).
if !timeEq(token.Expiry, expectedExpiry, 2*time.Second) {
return fmt.Errorf("expected expired_in to be %s, got %s", expectedExpiry, token.Expiry)
}