mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
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:
@ -410,7 +410,7 @@ func TestPGCoordinatorSingle_SendsHeartbeats(t *testing.T) {
|
|||||||
}
|
}
|
||||||
require.Greater(t, heartbeats[0].Sub(start), time.Duration(0))
|
require.Greater(t, heartbeats[0].Sub(start), time.Duration(0))
|
||||||
require.Greater(t, heartbeats[1].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)
|
}, testutil.WaitMedium, testutil.IntervalMedium)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user