def test_evg_config_does_not_fails_if_task_timeout_too_high_on_mainline(self): timeout = under_test.TimeoutEstimate( expected_task_runtime=under_test.MAX_EXPECTED_TIMEOUT + 1, max_test_runtime=None) time_cmd = timeout.generate_timeout_cmd(is_patch=False, repeat_factor=1) self.assertGreater(time_cmd.exec_timeout, under_test.MAX_EXPECTED_TIMEOUT)
def test_too_high_a_timeout_raises_errors(self): timeout_est = under_test.TimeoutEstimate( max_test_runtime=5, expected_task_runtime=under_test.MAX_EXPECTED_TIMEOUT) with self.assertRaises(ValueError): timeout_est.generate_timeout_cmd(is_patch=True, repeat_factor=1)
def test_is_specified_should_return_false_when_no_data_is_specified(self): timeout_est = under_test.TimeoutEstimate(max_test_runtime=None, expected_task_runtime=None) self.assertFalse(timeout_est.is_specified())
def test_is_specified_should_return_true_when_a_task_runtime_is_specified(self): timeout_est = under_test.TimeoutEstimate(max_test_runtime=None, expected_task_runtime=3.14) self.assertTrue(timeout_est.is_specified())