Example #1
0
    def test__generate_timeouts_no_results(self):
        repeat_config = under_test.RepeatConfig(repeat_tests_secs=600)
        runtime_stats = []
        test_name = "dir/new_test.js"

        timeout_info = under_test._generate_timeouts(repeat_config, test_name, runtime_stats)

        self.assertIsNone(timeout_info.cmd)
Example #2
0
    def test__generate_timeouts(self):
        repeat_config = under_test.RepeatConfig(repeat_tests_secs=600)
        runtime_stats = [teststats_utils.TestRuntime(test_name="dir/test2.js", runtime=455.1)]
        test_name = "dir/test2.js"

        timeout_info = under_test._generate_timeouts(repeat_config, test_name, runtime_stats)

        self.assertEqual(timeout_info.exec_timeout, 1771)
        self.assertEqual(timeout_info.timeout, 1366)
Example #3
0
    def test__generate_timeouts_avg_runtime_is_zero(self):
        repeat_config = under_test.RepeatConfig(repeat_tests_secs=600)
        runtime_stats = [
            teststats_utils.TestRuntime(test_name="dir/test_with_zero_runtime.js", runtime=0)
        ]
        test_name = "dir/test_with_zero_runtime.js"

        timeout_info = under_test._generate_timeouts(repeat_config, test_name, runtime_stats)

        self.assertIsNone(timeout_info.cmd)