Manager: add canary test to timeout checker unit test
The `TestTaskTimeout()` unit test assumes specific durations for initial & subsequent sleeps of the timeout checker. The test will fail quite cryptically when that assumption doesn't hold, so just test for it at the start of the unit test.
This commit is contained in:
parent
09902d201c
commit
13307c5a24
@ -82,6 +82,13 @@ func TestTimeoutCheckerTiming(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTaskTimeout(t *testing.T) {
|
||||
// Canary test: if these constants do not have the expected value, the test
|
||||
// will fail rather cryptically.
|
||||
if !assert.Equal(t, 5*time.Minute, timeoutInitialSleep, "timeoutInitialSleep does not have the expected value") ||
|
||||
!assert.Equal(t, 1*time.Minute, timeoutCheckInterval, "timeoutCheckInterval does not have the expected value") {
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
ttc, finish, mocks := timeoutCheckerTestFixtures(t)
|
||||
defer finish()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user