◐ Shell
clean mode source ↗

Message 319689 - Python tracker

> test_list leaked [3] memory blocks, sum=3

Memory block leaks are very different from reference leaks. Memory block are low level allocations. Python has *many* internal caches: tuple uses an internal "free list" for example. The first runs of the tests (2 runs when using -R 2:3) is used to warmup these caches.

Maybe regrtest -R should raise an error, or at least emit a big warning when using -R with less than 3 warmup runs.

By the way, regrtest has a very old bug: -R 3:3 runs the test 7 times, not 6 times. See runtest_inner() in Lib/test/libregrtest/runtest.py:

            test_runner()
            if ns.huntrleaks:
                refleak = dash_R(the_module, test, test_runner, ns.huntrleaks)

The code should be:

            if ns.huntrleaks:
                refleak = dash_R(the_module, test, test_runner, ns.huntrleaks)
            else:
                test_runner()

Do you want to write a PR for that? I should make our Refleaks buildbots 1/7 faster ;-)