Content-Length: 298078 | pFad | https://github.com/python/cpython/issues/108834

6C regrtest should re-run failed tests in subprocesses · Issue #108834 · python/cpython · GitHub
Skip to content

regrtest should re-run failed tests in subprocesses #108834

@vstinner

Description

@vstinner

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

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/108834

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy