Skip to content

Commit

Permalink
gh-1463: testing: Expand refleak checker section (GH-1468)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lincoln-developer authored Dec 12, 2024
1 parent d0661a5 commit 0b9001f
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions testing/run-write-tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,21 @@ if the failures are transient or consistent.
The ``-uall`` flag allows the use of all available
resources so as to not skip tests requiring, for example, Internet access.

To check for reference leaks (only needed if you modified C code), use the
``-R`` flag. For example, ``-R 3:2`` will first run the test 3 times to settle
down the reference count, and then run it 2 more times to verify if there are
any leaks.
To check for reference leaks (only needed if you modified C code),
you can enable reference leak checking during testing using the ``-R`` flag.
For example, using the command::

python -m test <test_name> -R :

This default setting performs a few initial warm-up runs to stabilize the reference count,
followed by additional runs to check for leaks.

If you want more control over the number of runs, you can specify ``warmups`` and ``repeats`` explicitly::

python -m test <test_name> -R <warmups>:<repeats>

For instance, ``-R 3:2`` will first run the test 3 times to settle down the
reference count, and then run it 2 more times to check for leaks.

You can also execute the ``Tools/scripts/run_tests.py`` script as found in a
CPython checkout. The script tries to balance speed with thoroughness. But if
Expand Down

0 comments on commit 0b9001f

Please sign in to comment.