Skip to content

Commit

Permalink
Merge pull request #436 from Kuadrant/fix-flaky-tests
Browse files Browse the repository at this point in the history
fix: flaky tests
  • Loading branch information
guicassolato authored Oct 17, 2023
2 parents b81a6d2 + 666d1bd commit e1d433a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions api/v1beta2/auth_config_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ func TestConvertTo(t *testing.T) {
sort.Slice(converted.Spec.Callbacks, func(i, j int) bool {
return converted.Spec.Callbacks[i].Name < converted.Spec.Callbacks[j].Name
})
sort.Slice(converted.Spec.DenyWith.Unauthenticated.Headers, func(i, j int) bool {
return converted.Spec.DenyWith.Unauthenticated.Headers[i].Name < converted.Spec.DenyWith.Unauthenticated.Headers[j].Name
})
sort.Slice(converted.Spec.DenyWith.Unauthorized.Headers, func(i, j int) bool {
return converted.Spec.DenyWith.Unauthorized.Headers[i].Name < converted.Spec.DenyWith.Unauthorized.Headers[j].Name
})

expected := hubAuthConfig()
if !reflect.DeepEqual(expected, converted) {
Expand Down
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 e1d433a

Please sign in to comment.