From 5bbc9e247a3a95bf93e8cbb2e08014840973e399 Mon Sep 17 00:00:00 2001 From: Lincoln-developer Date: Tue, 5 Nov 2024 15:20:08 +0300 Subject: [PATCH 1/4] Added refleak checker option under testing --- testing/run-write-tests.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/testing/run-write-tests.rst b/testing/run-write-tests.rst index f9323463a..f4df7591f 100644 --- a/testing/run-write-tests.rst +++ b/testing/run-write-tests.rst @@ -86,10 +86,16 @@ 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 -R : + +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. +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 From 1702799e5efbd99cab9cf87ca2bc0938e06bb916 Mon Sep 17 00:00:00 2001 From: Lincoln-developer Date: Tue, 5 Nov 2024 15:37:47 +0300 Subject: [PATCH 2/4] Removed trailing whitespaces from documentation --- testing/run-write-tests.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/run-write-tests.rst b/testing/run-write-tests.rst index f4df7591f..b7eeee7ad 100644 --- a/testing/run-write-tests.rst +++ b/testing/run-write-tests.rst @@ -86,8 +86,8 @@ 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), -you can enable reference leak checking during testing using the ``-R`` flag. +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 -R : From eb36fbcca12cd553099a83d9c04a983a3113cf96 Mon Sep 17 00:00:00 2001 From: Lincoln-developer Date: Wed, 6 Nov 2024 18:40:07 +0300 Subject: [PATCH 3/4] Updated refleak documentation to include default --- testing/run-write-tests.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/testing/run-write-tests.rst b/testing/run-write-tests.rst index b7eeee7ad..dbc9af747 100644 --- a/testing/run-write-tests.rst +++ b/testing/run-write-tests.rst @@ -90,6 +90,14 @@ 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 -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:: + python -m test -R : This enables the refleak checker option, allowing you to perform warm-up runs From ddd17239f11083bfa18d24a352c53ee90b386ff4 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 11 Dec 2024 14:39:50 +0100 Subject: [PATCH 4/4] Apply suggestions from code review --- testing/run-write-tests.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/testing/run-write-tests.rst b/testing/run-write-tests.rst index dbc9af747..bfb5eb83c 100644 --- a/testing/run-write-tests.rst +++ b/testing/run-write-tests.rst @@ -95,13 +95,10 @@ For example, using the command:: 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:: +If you want more control over the number of runs, you can specify ``warmups`` and ``repeats`` explicitly:: python -m test -R : -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. 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.