Skip to content

Commit

Permalink
fix: flaky tests due to weak concurrency coordination using sleep dir…
Browse files Browse the repository at this point in the history
…ective
  • Loading branch information
guicassolato committed Oct 16, 2023
1 parent 57e0570 commit 666d1bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/evaluators/identity/oidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ func TestOidcProviderRefresh(t *testing.T) {

authCredMock := mock_auth.NewMockAuthCredentials(ctrl)

evaluator := NewOIDC(fmt.Sprintf("http://%v", oidcServerHost), authCredMock, 1, context.TODO())
evaluator := NewOIDC(fmt.Sprintf("http://%v", oidcServerHost), authCredMock, 3, context.TODO())
defer evaluator.Clean(context.Background())

assert.Check(t, evaluator.refresher != nil)

time.Sleep(2 * time.Second)
time.Sleep(4 * time.Second)
assert.Equal(t, 2, count)
assert.Equal(t, fmt.Sprintf("http://%v/auth?count=2", oidcServerHost), evaluator.provider.Endpoint().AuthURL)
}
Expand Down

0 comments on commit 666d1bd

Please sign in to comment.