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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user