fix: Remove use of require in require.Eventually in tests (#3110)

* fix: Remove use of `require` in `require.Eventually` in tests

Because require uses `t.FailNow()` and `require.Eventually` runs the
function in a goroutine, which is not allowed.

* feat: Add ruleguard for require.Eventually

Co-authored-by: Cian Johnston <cian@coder.com>
This commit is contained in:
Mathias Fredriksson
2022-07-22 20:02:49 +03:00
committed by GitHub
co-authored by Cian Johnston
parent 3bb760576b
commit 51dd1fde3b
10 changed files with 74 additions and 46 deletions
+3 -1
View File
@@ -78,7 +78,9 @@ func TestTunnel(t *testing.T) {
require.Eventually(t, func() bool {
res, err := fTunServer.requestHTTP()
require.NoError(t, err)
if !assert.NoError(t, err) {
return false
}
defer res.Body.Close()
_, _ = io.Copy(io.Discard, res.Body)