GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — regrtest should re-run failed tests in subprocesses · Issue #108834 · python/cpython

regrtest should re-run failed tests in subprocesses #108834

New issue
Copy link
New issue
Copy link
Closed
Closed
regrtest should re-run failed tests in subprocesses#108834
Copy link
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement

Description

@vstinner
vstinner
opened on Sep 2, 2023
Issue body actions

Feature or enhancement

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Proposal:

Buildbots and GitHub Actions run the Python test suite with --verbose2 option to re-run failed tests in verbose mode. The current regrtest implementation is the re-run tests in the main process. It is not reliable: if a test crash or timeout, the main process cannot get back the control since the process is killed. Usually, there is no final report after the test is re-run, and the output is just "truncated".

I propose to re-run failed tests in subprocesses to make them more reliable:

  • Each test file is run in a fresh process and so does not inherit the state of previously executed tests. It runs in a known and reproducible state: threads, signals, etc.
  • The main process can kill the worker process if it hangs.
  • If faulthandler kills a worker process on a timeout, the main control detects it and continues its regular work.
  • Same if a worker process is killed because of a fatal error: Python Fatal Error, segmentation fault, etc.
  • Regular regrtest features can be re-used, like detection of leaking temporary files.

I'm working on an implementation.

Linked PRs

  • gh-108834: regrtest reruns failed tests in subprocesses #108839
  • gh-108834: Cleanup libregrtest #108858
  • gh-108834: regrtest --fail-rerun exits with code 5 #108896
  • [3.12] gh-108834: Sync libregrtest with the main branch #108966

Activity

  1. vstinner
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Sep 2, 2023
  2. vstinner
    added 5 commits that reference this issue on Sep 3, 2023

    pythongh-108834: regrtest reruns failed tests in subprocesses

    abf47ca

    pythongh-108834: regrtest reruns failed tests in subprocesses

    d3a42fa

    pythongh-108834: regrtest reruns failed tests in subprocesses

    c3cce6c

    pythongh-108834: regrtest reruns failed tests in subprocesses

    ff0049a

    pythongh-108834: regrtest reruns failed tests in subprocesses

    dda3b23
  3. AlexWaygood
    added
    testsTests in the Lib/test dirTests in the Lib/test dir
    on Sep 3, 2023
  4. vstinner
    added 11 commits that reference this issue on Sep 3, 2023

    pythongh-108834: regrtest reruns failed tests in subprocesses

    1ae6964

    gh-108834: regrtest reruns failed tests in subprocesses (#108839)

    31c2945

    pythongh-108834: Cleanup libregrtest

    a489840

    pythongh-108834: regrtest --fail-rerun exits with code 5

    e013736

    pythongh-108834: regrtest --fail-rerun exits with code 5

    7e236b6

    gh-108834: regrtest --fail-rerun exits with code 5 (#108896)

    1170d5a

    pythongh-108834: Cleanup libregrtest

    60092e9

    pythongh-108834: Cleanup libregrtest

    f878f60

    pythongh-108834: regrtest reruns failed tests in subprocesses (python…

    3f81740

    pythongh-108834: regrtest --fail-rerun exits with code 5 (python#108896)

    4f7e7b9

    pythongh-108834: Cleanup libregrtest

    de5a058
  5. Yhg1s
    added a commit that references this issue on Sep 8, 2023

    [3.12] gh-108834: Sync libregrtest with the main branch (#108966)

    0855b2c
  6. vstinner
    added 2 commits that reference this issue on Sep 8, 2023

    pythongh-108834: Refactor Regrtest.main()

    afbccd6

    pythongh-108834: Refactor Regrtest.main()

    436fbe8
  7. vstinner
    closed this as completedon Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.