From 7e5fc9f111b4cbdabee6d8c484a155a914bace1a Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Fri, 13 Mar 2026 01:08:44 -0700 Subject: [PATCH] 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 --- internal/grpcserver/grpcserver_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/grpcserver/grpcserver_test.go b/internal/grpcserver/grpcserver_test.go index 13f8ae1..6a83c8b 100644 --- a/internal/grpcserver/grpcserver_test.go +++ b/internal/grpcserver/grpcserver_test.go @@ -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)