ci: improve 'tfail in goroutine' ruleguard rule (#19682)

This PR improves the ruleguard rule for detecting `t.Fail` calls in goroutines. It picks up additional violations, of which are fixed in this PR.
See self-review for details.

The motivation for fixing this comes from a flake I fixed in https://github.com/coder/coder/pull/19599, where tests would fail from a `require` in an `Eventually`.
This commit is contained in:
Ethan
2025-09-04 14:28:29 +10:00
committed by GitHub
parent 1b4ce0909c
commit 50704a5014
4 changed files with 9 additions and 12 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ import (
"testing"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/coder/coder/v2/archive"
@@ -88,7 +89,7 @@ func TestPostFiles(t *testing.T) {
data := make([]byte, 1024)
_, err := client.Upload(ctx, codersdk.ContentTypeTar, bytes.NewReader(data))
end.Done()
require.NoError(t, err)
assert.NoError(t, err)
}()
}
wg.Done()