[Python-Dev] New work-in-progress bisection tool for the Python test suite (in regrtest)
brett at python.org
Fri Jun 16 13:00:49 EDT 2017
Great idea! I had thought about doing something similar to this years ago
to help diagnose when a test passes in isolation but somehow fails due to
one of the bazillion of other tests that ran previously (which can be hard
to narrow down if the failure is not early on in a test run).
On Fri, 16 Jun 2017 at 09:06 Victor Stinner <victor.stinner at gmail.com>
> Last weeks, I worked on a new tool to bisect failing tests because
> it's painful to bisect manually reference leaks (I remove as much code
> as possible until the code is small enough to be reviewable manually).
> See the bisect_test.py script attached to this issue:
> With the help of Louie Lu, I added new --list-cases option to "python
> -m test", so you can now list all test cases and write it into a text
> ./python -m test --list-cases test_os > tests
> I also added a new --matchfile option, to filter tests using a text
> file which contains one pattern per line:
> ./python -m test --matchfile=tests test_os
> fnmatch is used to match test names, so "*" joker character can be
> used in test names.
> My bisection tool takes a text file with the --matchfile format (one
> pattern per line) and creates a random subset of tests with half of
> the tests. If tests still fail, use the subset. Otherwise, create a
> new random subset. Loop until the subset contains a single test
> (configurable threshold, -n command line option).
> The long term plan is to integrate the bisection feature directly into
> Right now, my script is hardcoded to bisect reference leak bugs, but
> it should be easy to modify it to bisect other test issues like test
> creating files without removing it ("ENV_CHANGED" failure in
> For example, a core file is dumped when running test_subprocess on
> FreeBSD buildbots:
> But I'm unable to reproduce the issue on my FreeBSD. It would be nice
> to be able to automate the bisection on the buildbot directly.
> --list-cases and --matchfile options are now available in 2.7, 3.5,
> 3.6 and master (3.7) branches.
> TODO: doctest tests are only partially supported, see:
> Python-Dev mailing list
> Python-Dev at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev