def get_tests_to_retry(results): # If the --retry-only-retry-on-failure-tests command line argument # is passed , then a set of test failures with the RetryOnFailure # expectation from the last run of tests will be returned. The # self.last_runs_retry_on_failure_tests will be set to an empty set # for the next run of tests. Otherwise all regressions from the # last run will be returned. if self.args.retry_only_retry_on_failure_tests: ret = self.last_runs_retry_on_failure_tests.copy() self.last_runs_retry_on_failure_tests = set() return ret else: return json_results.regressions(results)
def _run_tests(self, result_set, test_set, all_tests): h = self.host self._run_one_set(self.stats, result_set, test_set) regressions = sorted(json_results.regressions(result_set)) retry_limit = self.args.retry_limit while retry_limit and regressions: if retry_limit == self.args.retry_limit: self.flush() self.args.overwrite = False self.printer.should_overwrite = False self.args.verbose = min(self.args.verbose, 1) self.print_('') self.print_('Retrying failed tests (attempt #%d of %d)...' % (self.args.retry_limit - retry_limit + 1, self.args.retry_limit)) self.print_('') stats = Stats(self.args.status_format, h.time, 1) stats.total = len(regressions) tests_to_retry = TestSet(isolated_tests=list(regressions)) retry_set = ResultSet() self._run_one_set(stats, retry_set, tests_to_retry) result_set.results.extend(retry_set.results) regressions = json_results.regressions(retry_set) retry_limit -= 1 if retry_limit != self.args.retry_limit: self.print_('') full_results = json_results.make_full_results(self.args.metadata, int(h.time()), all_tests, result_set) return (json_results.exit_code_from_full_results(full_results), full_results)