def test__calculate_exec_timeout(self): repeat_config = under_test.RepeatConfig(repeat_tests_secs=600) avg_test_runtime = 455.1 exec_timeout = under_test._calculate_exec_timeout(repeat_config, avg_test_runtime) self.assertEqual(1771, exec_timeout)
def test__calculate_exec_timeout(self): avg_test_runtime = 455.1 repeat_tests_secs = 600 exec_timeout = under_test._calculate_exec_timeout( repeat_tests_secs, avg_test_runtime) self.assertEqual(1531, exec_timeout)
def test_average_timeout_greater_than_execution_time(self): repeat_config = under_test.RepeatConfig(repeat_tests_secs=600, repeat_tests_min=2) avg_test_runtime = 750 exec_timeout = under_test._calculate_exec_timeout(repeat_config, avg_test_runtime) # The timeout needs to be greater than the number of the test * the minimum number of runs. minimum_expected_timeout = avg_test_runtime * repeat_config.repeat_tests_min self.assertGreater(exec_timeout, minimum_expected_timeout)