mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(cli): fix flaky temporal assertion in TestTokens (#22654)
Fixes https://github.com/coder/internal/issues/1379
This commit is contained in:
+2
-1
@@ -188,7 +188,8 @@ func TestTokens(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
// Validate that token was expired
|
||||
if token, err := client.APIKeyByName(ctx, secondUser.ID.String(), "token-two"); assert.NoError(t, err) {
|
||||
require.True(t, token.ExpiresAt.Before(time.Now()))
|
||||
now := time.Now()
|
||||
require.False(t, token.ExpiresAt.After(now), "token expiresAt should not be in the future, but was %s (now=%s)", token.ExpiresAt, now)
|
||||
}
|
||||
|
||||
// Delete by ID (explicit delete flag)
|
||||
|
||||
Reference in New Issue
Block a user