]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-108834: Sync libregrtest with the main branch (#108966)
authorVictor Stinner <vstinner@python.org>
Fri, 8 Sep 2023 13:14:17 +0000 (15:14 +0200)
committerGitHub <noreply@github.com>
Fri, 8 Sep 2023 13:14:17 +0000 (15:14 +0200)
commit0855b2c8b69f02f86f837875acda148479e6a061
tree4e42efd35d33d09170e4b5b02bc350db4672b758
parenteeaae92b496bf75e8c937af1d5fd277d71fb7334
[3.12] gh-108834: Sync libregrtest with the main branch (#108966)

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

When using --rerun option, regrtest now re-runs failed tests
in verbose mode in fresh worker processes to have more
deterministic behavior. So it can write its final report even
if a test killed a worker progress.

Add --fail-rerun option to regrtest: exit with non-zero exit code
if a test failed pass passed when re-run in verbose mode (in a
fresh process). That's now more useful since tests can pass
when re-run in a fresh worker progress, whereas they failed
when run after other tests when tests are run sequentially.

Rename --verbose2 option (-w) to --rerun. Keep --verbose2 as a
deprecated alias.

Changes:

* Fix and enhance statistics in regrtest summary. Add "(filtered)"
  when --match and/or --ignore options are used.
* Add RunTests class.
* Add TestResult.get_rerun_match_tests() method
* Rewrite code to serialize/deserialize worker arguments as JSON
  using a new WorkerJob class.
* Fix stats when a test is run with --forever --rerun.
* If failed test names cannot be parsed, log a warning and don't
  filter tests.
* test_regrtest.test_rerun_success() now uses a marker file, since
  the test is re-run in a separated process.
* Add tests on normalize_test_name() function.
* Add test_success() and test_skip() tests to test_regrtest.

(cherry picked from commit 31c2945f143c6b80c837fcf09a5cfb85fea9ea4c)

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

When the --fail-rerun option is used and a test fails and then pass,
regrtest now uses exit code 5 ("rerun) instead of 2 ("bad test").

(cherry picked from commit 1170d5a292b46f754cd29c245a040f1602f70301)

* gh-108416: Mark slow but not CPU bound test methods with requires_resource('walltime') (GH-108480)

(cherry picked from commit 1e0d62793a84001e92f1c80b511d3a212b435acc)

* Manually sync Lib/test/libregrtest/ from main

---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
29 files changed:
Lib/test/_test_multiprocessing.py
Lib/test/bisect_cmd.py
Lib/test/libregrtest/cmdline.py
Lib/test/libregrtest/main.py
Lib/test/libregrtest/runtest.py
Lib/test/libregrtest/runtest_mp.py
Lib/test/libregrtest/utils.py
Lib/test/support/__init__.py
Lib/test/support/testresult.py
Lib/test/test_concurrent_futures/executor.py
Lib/test/test_concurrent_futures/test_wait.py
Lib/test/test_eintr.py
Lib/test/test_faulthandler.py
Lib/test/test_httplib.py
Lib/test/test_imaplib.py
Lib/test/test_io.py
Lib/test/test_logging.py
Lib/test/test_poll.py
Lib/test/test_regrtest.py
Lib/test/test_signal.py
Lib/test/test_smtpnet.py
Lib/test/test_ssl.py
Lib/test/test_subprocess.py
Lib/test/test_urllib2net.py
Lib/test/test_urllibnet.py
Lib/test/test_xmlrpc.py
Misc/NEWS.d/next/Tests/2023-09-03-02-01-55.gh-issue-108834.iAwXzj.rst [new file with mode: 0644]
Misc/NEWS.d/next/Tests/2023-09-03-06-17-12.gh-issue-108834.fjV-CJ.rst [new file with mode: 0644]
Misc/NEWS.d/next/Tests/2023-09-03-20-15-49.gh-issue-108834.Osvmhf.rst [new file with mode: 0644]