Skip to content

Commit 305fcaf

Browse files
committed
Fix flaky test
1 parent e0d0879 commit 305fcaf

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
*.tar.gz
44
*.dic
55
coverage.txt
6+
cover.out
67
**/coverage.txt
8+
**/cover.out
79
.vscode
10+
tmp/

manager/token_manager_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,10 @@ func TestEntraidTokenManager_Streaming(t *testing.T) {
857857
assert.Equal(t, time.Duration(0), toRenewal)
858858
assert.True(t, expiresIn > toRenewal)
859859

860+
// wait for request token to be called
860861
<-done
862+
// wait a bit for listener to be notified
863+
<-time.After(10 * time.Millisecond)
861864
assert.NoError(t, cancel())
862865

863866
assert.InDelta(t, stop.Sub(start), time.Duration(tm.retryOptions.InitialDelayMs)*time.Millisecond, float64(200*time.Millisecond))

0 commit comments

Comments
 (0)