mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -409,8 +409,8 @@ func TestPGCoordinatorSingle_SendsHeartbeats(t *testing.T) {
|
||||
if len(heartbeats) < 2 {
|
||||
return false
|
||||
}
|
||||
require.Greater(t, heartbeats[0].Sub(start), time.Duration(0))
|
||||
require.Greater(t, heartbeats[1].Sub(start), time.Duration(0))
|
||||
assert.Greater(t, heartbeats[0].Sub(start), time.Duration(0))
|
||||
assert.Greater(t, heartbeats[1].Sub(start), time.Duration(0))
|
||||
return assert.Greater(t, heartbeats[1].Sub(heartbeats[0]), tailnet.HeartbeatPeriod*3/4)
|
||||
}, testutil.WaitMedium, testutil.IntervalMedium)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user