Merge pull request #17107 from redwrasse/redwrasse/return-early-expectfun

testutils: return early instead of first breaking in LogObserver.Expe…
This commit is contained in:
Benjamin Wang 2023-12-15 09:53:40 +00:00 committed by GitHub
commit 51bd8bd4e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,13 +79,10 @@ func (logOb *LogObserver) ExpectFunc(ctx context.Context, filter func(string) bo
}
if len(res) >= count {
break
return res, nil
}
}
if len(res) >= count {
return res, nil
}
time.Sleep(10 * time.Millisecond)
}
}