From 561e5689db8d11ff8b6e3d7f46a037ad19b67a86 Mon Sep 17 00:00:00 2001 From: Henning F <18215579+CaptainStandby@users.noreply.github.com> Date: Sat, 17 Dec 2022 09:37:19 +0100 Subject: [PATCH] chore: cleanup test (#2964) --- driver/config/config_test.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/driver/config/config_test.go b/driver/config/config_test.go index b167b97e9c1..b7fdd214010 100644 --- a/driver/config/config_test.go +++ b/driver/config/config_test.go @@ -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