[3.12] gh-108834: Sync libregrtest with the main branch#108966
Conversation
…#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 31c2945)
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 1170d5a)
…es_resource('walltime') (pythonGH-108480)
(cherry picked from commit 1e0d627)
The problem is that regrtest changes were not backported in the same order than main changes :-( And so I checked manually that at the end, files are the same in the two branches. Now, the remaining change is: diff -u Lib/test/libregrtest/utils.py ../main/Lib/test/libregrtest/utils.py
--- Lib/test/libregrtest/utils.py 2023-09-06 00:39:26.893256876 +0200
+++ ../main/Lib/test/libregrtest/utils.py 2023-09-06 00:27:30.431075564 +0200
@@ -228,6 +228,11 @@
ldflags_nodist = sysconfig.get_config_var('PY_LDFLAGS_NODIST') or ''
build = []
+
+ # --disable-gil
+ if sysconfig.get_config_var('Py_NOGIL'):
+ build.append("nogil")
+
if hasattr(sys, 'gettotalrefcount'):
# --with-pydebug
build.append('debug')I could backport it as well (it does nothing in 3.12), but I chose to skip it for now :-) |
Sorry, something went wrong.
|
Sorry, @vstinner and @Yhg1s, I could not cleanly backport this to |
Sorry, something went wrong.
Copy link Copy MarkdownSorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.