mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
co-authored by
Cian Johnston
parent
3bb760576b
commit
51dd1fde3b
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user