From 89cee2dd813672ef7e170601166b0968a4e83662 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Thu, 5 Mar 2026 10:18:51 +0000 Subject: [PATCH] chore(cli): fix flaky temporal assertion in TestTokens (#22654) Fixes https://github.com/coder/internal/issues/1379 --- cli/tokens_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/tokens_test.go b/cli/tokens_test.go index f13ffba334..fe68a61a5a 100644 --- a/cli/tokens_test.go +++ b/cli/tokens_test.go @@ -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)