Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression tests with -w should only re-run affected test methods, not the entire file #88874

Closed
ambv opened this issue Jul 22, 2021 · 4 comments
Assignees
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes performance Performance or resource usage tests Tests in the Lib/test dir

Comments

@ambv
Copy link
Contributor

ambv commented Jul 22, 2021

BPO 44708
Nosy @ambv, @pablogsal, @miss-islington
PRs
  • bpo-44708: Only re-run test methods that match names of previously failing test methods #27287
  • [3.10] bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287) #27290
  • [3.9] bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287) #27293
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ambv'
    closed_at = <Date 2021-07-22.21:18:18.842>
    created_at = <Date 2021-07-22.14:32:29.824>
    labels = ['3.11', 'tests', '3.9', '3.10', 'performance']
    title = 'Regression tests with -w should only re-run affected test methods, not the entire file'
    updated_at = <Date 2021-07-22.21:18:18.842>
    user = 'https://github.com/ambv'

    bugs.python.org fields:

    activity = <Date 2021-07-22.21:18:18.842>
    actor = 'lukasz.langa'
    assignee = 'lukasz.langa'
    closed = True
    closed_date = <Date 2021-07-22.21:18:18.842>
    closer = 'lukasz.langa'
    components = ['Tests']
    creation = <Date 2021-07-22.14:32:29.824>
    creator = 'lukasz.langa'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44708
    keywords = ['patch']
    message_count = 4.0
    messages = ['397985', '397994', '398001', '398007']
    nosy_count = 3.0
    nosy_names = ['lukasz.langa', 'pablogsal', 'miss-islington']
    pr_nums = ['27287', '27290', '27293']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue44708'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @ambv
    Copy link
    Contributor Author

    ambv commented Jul 22, 2021

    When the CPython test suite re-runs a flaky failed test, it doesn’t actually re-run just that failed test but the entire test file. The most common case for flaky tests is when networking, threading, or multiprocessing is involved. Frustratingly those are some of the largest test files we have. Re-running them takes a lot of time.

    Instead of re-running the entire file, regrtest should only re-run what actually failed.

    NOTE: I added 3.10 and 3.9 to this issue even though it's not a pure bugfix. The reason is that this can visibly speed up CI for open pull requests.

    (Of course, it would be best to avoid flaky tests altogether and we’re working on that, but re-running what failed is a pragmatic stopgap that is necessary in times of distributed CI that we don’t fully control.)

    @ambv ambv added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Jul 22, 2021
    @ambv ambv self-assigned this Jul 22, 2021
    @ambv ambv added tests Tests in the Lib/test dir performance Performance or resource usage 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Jul 22, 2021
    @ambv ambv self-assigned this Jul 22, 2021
    @ambv ambv added tests Tests in the Lib/test dir performance Performance or resource usage labels Jul 22, 2021
    @ambv
    Copy link
    Contributor Author

    ambv commented Jul 22, 2021

    New changeset f1afef5 by Łukasz Langa in branch 'main':
    bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287)
    f1afef5

    @ambv
    Copy link
    Contributor Author

    ambv commented Jul 22, 2021

    New changeset 9608719 by Miss Islington (bot) in branch '3.10':
    bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287) (GH-27290)
    9608719

    @ambv
    Copy link
    Contributor Author

    ambv commented Jul 22, 2021

    New changeset 0f55d21 by Łukasz Langa in branch '3.9':
    [3.9] bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287) (GH-27293)
    0f55d21

    @ambv ambv closed this as completed Jul 22, 2021
    @ambv ambv closed this as completed Jul 22, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes 3.11 only security fixes performance Performance or resource usage tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant