Skip to content

Commit 1824510

Browse files
committed
change some comments
1 parent 424a748 commit 1824510

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/clients/key_flow_continuous_refresh_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ func TestContinuousRefreshToken(t *testing.T) {
2020
// For this to work, we need to increase precision of the expiration timestamps
2121
jwt.TimePrecision = time.Millisecond
2222

23-
// Set up timing for the test
24-
accessTokensTimeToLive := 1 * time.Second
23+
// Refresher settings
2524
timeStartBeforeTokenExpiration := 500 * time.Millisecond
2625
timeBetweenContextCheck := 10 * time.Millisecond
2726
timeBetweenTries := 100 * time.Millisecond
2827

28+
// All generated acess tokens will have this time to live
29+
accessTokensTimeToLive := 1 * time.Second
30+
2931
tests := []struct {
3032
desc string
3133
contextClosesIn time.Duration
@@ -212,7 +214,7 @@ func TestContinuousRefreshTokenConcurrency(t *testing.T) {
212214

213215
// The access token at the start
214216
accessTokenFirst, err := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.RegisteredClaims{
215-
ExpiresAt: jwt.NewNumericDate(time.Now().Add(10 * time.Second)), // Much longer expiration
217+
ExpiresAt: jwt.NewNumericDate(time.Now().Add(10 * time.Second)),
216218
}).SignedString([]byte("token-first"))
217219
if err != nil {
218220
t.Fatalf("failed to create first access token: %v", err)

0 commit comments

Comments
 (0)