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
@@ -463,19 +473,19 @@ func (s) TestTokenFileCallCreds_BackoffBehavior(t *testing.T) {
463
473
nextRetryTime4:=impl.nextRetryTime
464
474
impl.mu.Unlock()
465
475
466
-
if!nextRetryTime4.Equal(nextRetryTime3) {
467
-
t.Errorf("nextRetryTime should not change due to backoff. Got: %v, Want: %v", nextRetryTime4, nextRetryTime3)
476
+
if!nextRetryTime4.Equal(wantNextRetryTime) {
477
+
t.Errorf("nextRetryTime should not change due to backoff. Got: %v, Want: %v", nextRetryTime4, wantNextRetryTime)
468
478
}
469
479
ifretryAttempt4!=retryAttempt3 {
470
480
t.Error("Retry attempt should not change due to backoff")
471
481
}
472
482
473
-
// Fast-forward the backoff retry time to allow next retry attempt.
483
+
// Fifth call should succeed since the file now exists
484
+
// and the backoff has expired.
485
+
// Set the backoff retry time in the past to allow next retry attempt.
474
486
impl.mu.Lock()
475
487
impl.nextRetryTime=time.Now().Add(-1*time.Minute)
476
488
impl.mu.Unlock()
477
-
// Fifth call should succeed since the file now exists
478
-
// and the backoff has expired.
479
489
_, err=creds.GetRequestMetadata(ctx)
480
490
iferr!=nil {
481
491
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)
0 commit comments