You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: credentials/jwt/jwt_token_file_call_creds_test.go
+17-19Lines changed: 17 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -478,25 +478,23 @@ func (s) TestTokenFileCallCreds_BackoffBehavior(t *testing.T) {
478
478
// and the backoff has expired.
479
479
_, err=creds.GetRequestMetadata(ctx)
480
480
iferr!=nil {
481
-
t.Errorf("After creating valid token file, GetRequestMetadata() should eventually succeed, but got: %v", err)
482
-
t.Error("Backoff should expire and trigger new attempt on next RPC")
483
-
} else {
484
-
// If successful, verify error cache and backoff state were cleared.
485
-
impl.mu.Lock()
486
-
clearedErr:=impl.cachedError
487
-
retryAttempt:=impl.retryAttempt
488
-
nextRetryTime:=impl.nextRetryTime
489
-
impl.mu.Unlock()
490
-
491
-
ifclearedErr!=nil {
492
-
t.Errorf("After successful retry, cached error should be cleared, got: %v", clearedErr)
493
-
}
494
-
ifretryAttempt!=0 {
495
-
t.Errorf("After successful retry, retry attempt should be reset, got: %d", retryAttempt)
496
-
}
497
-
if!nextRetryTime.IsZero() {
498
-
t.Error("After successful retry, next retry time should be cleared")
499
-
}
481
+
t.Fatalf("After creating valid token file, backoff should expire and trigger a token reload on the next RPC. GetRequestMetadata() should eventually succeed, but got: %v", err)
482
+
}
483
+
// If successful, verify error cache and backoff state were cleared.
484
+
impl.mu.Lock()
485
+
clearedErr:=impl.cachedError
486
+
retryAttempt=impl.retryAttempt
487
+
nextRetryTime=impl.nextRetryTime
488
+
impl.mu.Unlock()
489
+
490
+
ifclearedErr!=nil {
491
+
t.Errorf("After successful retry, cached error should be cleared, got: %v", clearedErr)
492
+
}
493
+
ifretryAttempt!=0 {
494
+
t.Errorf("After successful retry, retry attempt should be reset, got: %d", retryAttempt)
495
+
}
496
+
if!nextRetryTime.IsZero() {
497
+
t.Error("After successful retry, next retry time should be cleared")
0 commit comments