Fix flaky gRPC renewal test timing

Increase token lifetime from 2s to 4s in TestRenewToken to prevent
the token from expiring before the gRPC call completes through bufconn.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 01:08:44 -07:00
parent cf02b8e2d8
commit 7e5fc9f111

View File

@@ -370,11 +370,11 @@ func TestRenewToken(t *testing.T) {
e := newTestEnv(t)
acct := e.createHumanAccount(t, "renewuser")
// Issue a short-lived token (2s) so we can wait past the 50% threshold.
tok := e.issueShortToken(t, acct, 2*time.Second)
// Issue a short-lived token (4s) so we can wait past the 50% threshold.
tok := e.issueShortToken(t, acct, 4*time.Second)
// Wait for >50% of lifetime to elapse.
time.Sleep(1100 * time.Millisecond)
time.Sleep(2100 * time.Millisecond)
cl := mciasv1.NewAuthServiceClient(e.conn)
ctx := authCtx(tok)