cpython/Lib/test/libregrtest
Victor Stinner 1069d38fa1
[3.7] bpo-36719: sync regrtest with master branch (GH-12967)
* Clean up code which checked presence of os.{stat,lstat,chmod} (GH-11643)

(cherry picked from commit 8377cd4fcd)

* bpo-36725: regrtest: add TestResult type (GH-12960)

* Add TestResult and MultiprocessResult types to ensure that results
  always have the same fields.
* runtest() now handles KeyboardInterrupt
* accumulate_result() and format_test_result() now takes a TestResult
* cleanup_test_droppings() is now called by runtest() and mark the
  test as ENV_CHANGED if the test leaks support.TESTFN file.
* runtest() now includes code "around" the test in the test timing
* Add print_warning() in test.libregrtest.utils to standardize how
  libregrtest logs warnings to ease parsing the test output.
* support.unload() is now called with abstest rather than test_name
* Rename 'test' variable/parameter to 'test_name'
* dash_R(): remove unused the_module parameter
* Remove unused imports

(cherry picked from commit 4d29983185)

* bpo-36725: Refactor regrtest multiprocessing code (GH-12961)

Rewrite run_tests_multiprocess() function as a new MultiprocessRunner
class with multiple methods to better report errors and stop
immediately when needed.

Changes:

* Worker processes are now killed immediately if tests are
  interrupted or if a test does crash (CHILD_ERROR): worker
  processes are killed.
* Rewrite how errors in a worker thread are reported to
  the main thread. No longer ignore BaseException or parsing errors
  silently.
* Remove 'finished' variable: use worker.is_alive() instead
* Always compute omitted tests. Add Regrtest.get_executed() method.

(cherry picked from commit 3cde440f20)

* bpo-36719: regrtest always detect uncollectable objects (GH-12951)

regrtest now always detects uncollectable objects. Previously, the
check was only enabled by --findleaks. The check now also works with
-jN/--multiprocess N.

--findleaks becomes a deprecated alias to --fail-env-changed.

(cherry picked from commit 75120d2205)

* bpo-34060: Report system load when running test suite for Windows (GH-8357)

While Windows exposes the system processor queue length, the raw value
used for load calculations on Unix systems, it does not provide an API
to access the averaged value. Hence to calculate the load we must track
and average it ourselves. We can't use multiprocessing or a thread to
read it in the background while the tests run since using those would
conflict with test_multiprocessing and test_xxsubprocess.

Thus, we use Window's asynchronous IO API to run the tracker in the
background with it sampling at the correct rate. When we wish to access
the load we check to see if there's new data on the stream, if there is,
we update our load values.


(cherry picked from commit e16467af0b)

* bpo-36719: Fix regrtest re-run (GH-12964)

Properly handle a test which fail but then pass.

Add test_rerun_success() unit test.

(cherry picked from commit 837acc1957)

* bpo-36719: regrtest closes explicitly WindowsLoadTracker (GH-12965)

Regrtest.finalize() now closes explicitly the WindowsLoadTracker
instance.

(cherry picked from commit 00db7c73af)
2019-04-26 12:16:30 +02:00
..
__init__.py
cmdline.py [3.7] bpo-36719: sync regrtest with master branch (GH-12967) 2019-04-26 12:16:30 +02:00
main.py [3.7] bpo-36719: sync regrtest with master branch (GH-12967) 2019-04-26 12:16:30 +02:00
refleak.py [3.7] bpo-36719: sync regrtest with master branch (GH-12967) 2019-04-26 12:16:30 +02:00
runtest.py [3.7] bpo-36719: sync regrtest with master branch (GH-12967) 2019-04-26 12:16:30 +02:00
runtest_mp.py [3.7] bpo-36719: sync regrtest with master branch (GH-12967) 2019-04-26 12:16:30 +02:00
save_env.py [3.7] bpo-36719: sync regrtest with master branch (GH-12967) 2019-04-26 12:16:30 +02:00
setup.py [3.7] bpo-36560: regrtest: don't collect the GC twice (GH-12747) (GH-12749) 2019-04-09 18:55:50 +02:00
utils.py [3.7] bpo-36719: sync regrtest with master branch (GH-12967) 2019-04-26 12:16:30 +02:00
win_utils.py [3.7] bpo-36719: sync regrtest with master branch (GH-12967) 2019-04-26 12:16:30 +02:00