Commit Graph

18 Commits

Author SHA1 Message Date
Victor Stinner 4d29983185
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
2019-04-26 04:08:53 +02:00
Victor Stinner bb4447897a
bpo-36560: regrtest: don't collect the GC twice (GH-12747)
dash_R() function of libregrtest doesn't call support.gc_collect()
directly anymore: it's already called by dash_R_cleanup().

Call dash_R_cleanup() before starting the loop.
2019-04-09 18:26:16 +02:00
Victor Stinner 5aaac94eeb
bpo-36560: Fix reference leak hunting in regrtest (GH-12744)
Fix reference leak hunting in regrtest: compute also deltas (of
reference count, allocated memory blocks, file descriptor count)
during warmup, to ensure that everything is initialized before
starting to hunt reference leaks.

Other changes:

* Replace gc.collect() with support.gc_collect()
* Move calls to read memory statistics from dash_R_cleanup() to
  dash_R()
* Pass regrtest 'ns' to dash_R()
* dash_R() is now more quiet with --quiet option (don't display
  progress).
* Precompute the full range for "for it in range(repcount):" to
  ensure that the iteration doesn't allocate anything new.
* dash_R() now is responsible to call warm_caches().
2019-04-09 14:23:47 +02:00
Victor Stinner 79b5d29041
bpo-36565: Fix libregrtest for Python without builtin _abc (GH-12733)
Fix reference hunting (``python3 -m test -R 3:3``) when Python has no
built-in abc module: fix _get_dump() reimplementation of libregrtest.
2019-04-09 01:36:34 +02:00
Ivan Levkivskyi 03e3c340a0
bpo-31333: Re-implement ABCMeta in C (#5273)
This adds C versions of methods used by ABCMeta that
improve performance of various ABC operations.
2018-02-18 12:41:58 +00:00
Ivan Levkivskyi d911e40e78
bpo-32226: PEP 560: improve typing module (#4906)
This PR re-designs the internal typing API using the new PEP 560 features.
However, there are only few minor changes in the public API.
2018-01-20 11:23:59 +00:00
Victor Stinner 6c2feabc5d bpo-31217: Fix regrtest -R for small integer (#3260)
Use a pool of integer objects toprevent false alarm when checking for
memory block leaks. Fill the pool with values in -1000..1000 which
are the most common (reference, memory block, file descriptor)
differences.

Co-Authored-By: Antoine Pitrou <pitrou@free.fr>
2017-09-01 13:05:27 +02:00
Antoine Pitrou 896145d9d2 bpo-26732: fix too many fds in processes started with the "forkserver" method (#2813)
* bpo-26732: fix too many fds in processes started with the "forkserver" method

A child process would inherit as many fds as the number of still-running children.

* Add blurb and test comment
2017-07-22 13:22:54 +02:00
Victor Stinner beeca6e1e5 bpo-30776: regrtest: reduce memleak false positive (#2484)
Only report a leak if each run leaks at least one memory block.
2017-06-29 10:32:49 +02:00
Victor Stinner 48b5c422ff bpo-30776: reduce regrtest -R false positives (#2422)
* Change the regrtest --huntrleaks checker to decide if a test file
  leaks or not. Require that each run leaks at least 1 reference.
* Warmup runs are now completely ignored: ignored in the checker test
  and not used anymore to compute the sum.
* Add an unit test for a reference leak.

Example of reference differences previously considered a failure
(leak) and now considered as success (success, no leak):

    [3, 0, 0]
    [0, 1, 0]
    [8, -8, 1]
2017-06-27 02:02:04 +02:00
Ivan Levkivskyi 7acffa23c9 bpo-29638: Fix spurious refleaks after typing is imported (#469) 2017-03-05 20:15:20 +02:00
Victor Stinner 17a63e2169 Fix regrtest -j0 -R output
Write also dots into stderr, instead of stdout.
2017-02-08 13:06:08 +01:00
Serhiy Storchaka 839102603c Issue #23839: Various caches now are cleared before running every test file. 2016-11-11 11:46:44 +02:00
Serhiy Storchaka 04c954d275 Issue #28649: Clear the typing module caches when search for reference leaks. 2016-11-09 23:51:54 +02:00
Victor Stinner 076fc872bc Issue #18174: "python -m test --huntrleaks ..." now also checks for leak of
file descriptors. Patch written by Richard Oudkerk.
2015-10-03 00:20:56 +02:00
Victor Stinner 9a14214aee Issue #25220: Fix "-m test --forever"
* Fix "-m test --forever": replace _test_forever() with self._test_forever()
* Add unit test for --forever
* Add unit test for a failing test
* Fix also some pyflakes warnings in libregrtest
2015-09-30 13:51:17 +02:00
Victor Stinner f33536c430 Issue #25220: Use print(flush=True) in libregrtest 2015-09-30 00:48:27 +02:00
Victor Stinner 3844fe5ed8 Issue #25220: Move most regrtest.py code to libregrtest 2015-09-26 10:38:01 +02:00