fix: loosen timing checks for heartbeats (#15923)

Fixes #15782.

I believe that Windows doesn't always have high-resolution timers available, so this PR loosens the check for PG Coordinator heartbeats, to avoid flakes like:

https://github.com/coder/coder/actions/runs/12397381823/job/34607639048
This commit is contained in:
Spike Curtis
2024-12-19 13:49:01 +04:00
committed by GitHub
parent 9ef22bebc4
commit 63572d9f53

View File

@ -410,7 +410,7 @@ func TestPGCoordinatorSingle_SendsHeartbeats(t *testing.T) {
}
require.Greater(t, heartbeats[0].Sub(start), time.Duration(0))
require.Greater(t, heartbeats[1].Sub(start), time.Duration(0))
return assert.Greater(t, heartbeats[1].Sub(heartbeats[0]), tailnet.HeartbeatPeriod*9/10)
return assert.Greater(t, heartbeats[1].Sub(heartbeats[0]), tailnet.HeartbeatPeriod*3/4)
}, testutil.WaitMedium, testutil.IntervalMedium)
}