Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-1463: Added Refleak Checker Option under testing. #1468

Merged
merged 4 commits into from
Dec 12, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions testing/run-write-tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,24 @@ if the failures are transient or consistent.
The ``-uall`` flag allows the use of all available
resources so as to not skip tests requiring, e.g., 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
For example::
encukou marked this conversation as resolved.
Show resolved Hide resolved

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

This enables the refleak checker option, allowing you to perform warm-up runs
to stabilize reference counts followed by additional runs to verify any leaks.
encukou marked this conversation as resolved.
Show resolved Hide resolved
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
Loading