Skip to content

Commit

Permalink
chore: cleanup test (#2964)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainStandby committed Dec 17, 2022
1 parent b6bd3f4 commit 561e568
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions driver/config/config_test.go
Expand Up @@ -1037,23 +1037,17 @@ func TestIdentitySchemaValidation(t *testing.T) {

// There are a bunch of log messages beeing logged. We are looking for a specific one.
timeout := time.After(time.Millisecond * 500)
outer:
for {
var success = false
for !success {
for _, v := range hook.AllEntries() {
s, err := v.String()
if err != nil {
t.Errorf("Unexpected Error: %s", err.Error())
continue
}

if strings.Contains(s, "The changed identity schema configuration is invalid and could not be loaded.") {
break outer
}
assert.NoErrorf(t, err, "Unexpected Error")
success = strings.Contains(s, "The changed identity schema configuration is invalid and could not be loaded.")
}

select {
case <-ctx.Done():
panic("the test could not complete as the context timed out before the file watcher updated")
t.Fatal("the test could not complete as the context timed out before the file watcher updated")
case <-timeout:
t.Fatal("Expected log line was not encountered within specified timeout")
default: //nothing
Expand Down

0 comments on commit 561e568

Please sign in to comment.