def validate_regression_range(testcase, testcase_file_path, job_type, revision_list, min_index):
    'Ensure that we found the correct min revision by testing earlier ones.'
    earlier_revisions = revision_list[(min_index - EARLIER_REVISIONS_TO_CONSIDER_FOR_VALIDATION):min_index]
    revision_count = min(len(earlier_revisions), REVISIONS_TO_TEST_FOR_VALIDATION)
    revisions_to_test = random.sample(earlier_revisions, revision_count)
    for revision in revisions_to_test:
        try:
            if _testcase_reproduces_in_revision(testcase, testcase_file_path, job_type, revision):
                testcase = data_handler.get_testcase_by_id(testcase.key.id())
                testcase.regression = 'NA'
                error_message = ('Low confidence in regression range. Test case crashes in revision r%d but not later revision r%d' % (revision, revision_list[min_index]))
                data_handler.update_testcase_comment(testcase, data_types.TaskState.ERROR, error_message)
                return False
        except errors.BadBuildError:
            pass
    return True
Ensure that we found the correct min revision by testing earlier ones.
def validate_regression_range(testcase, testcase_file_path, job_type, revision_list, min_index):
    
    earlier_revisions = revision_list[(min_index - EARLIER_REVISIONS_TO_CONSIDER_FOR_VALIDATION):min_index]
    revision_count = min(len(earlier_revisions), REVISIONS_TO_TEST_FOR_VALIDATION)
    revisions_to_test = random.sample(earlier_revisions, revision_count)
    for revision in revisions_to_test:
        try:
            if _testcase_reproduces_in_revision(testcase, testcase_file_path, job_type, revision):
                testcase = data_handler.get_testcase_by_id(testcase.key.id())
                testcase.regression = 'NA'
                error_message = ('Low confidence in regression range. Test case crashes in revision r%d but not later revision r%d' % (revision, revision_list[min_index]))
                data_handler.update_testcase_comment(testcase, data_types.TaskState.ERROR, error_message)
                return False
        except errors.BadBuildError:
            pass
    return True