This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ./python -m test --help output for refleaks seems wrong
Type: Stage: resolved
Components: Build Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Dennis Sweeney, iritkatriel, skip.montanaro, vstinner
Priority: normal Keywords: patch

Created on 2021-11-07 21:39 by skip.montanaro, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 29514 merged vstinner, 2021-11-10 11:03
Messages (7)
msg405916 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2021-11-07 21:39
Just preparing to make a refleaks test run, so I ran:

./python -m test --help

The output related to refleaks seemed suspicious:

...
Special runs:
  -l, --findleaks       deprecated alias to --fail-env-changed
...
  --fail-env-changed    if a test file alters the environment, mark the test as failed

It's not obvious that "--fail-env-changed" has anything to do with "--findleaks". Does the -l/--findleaks message need to be corrected?
msg405917 - (view) Author: Dennis Sweeney (Dennis Sweeney) * (Python committer) Date: 2021-11-07 22:01
IIUC you're looking for --huntrleaks/-R, not the unrelated --findleaks/-l:

In that -m test -h menu:

  -l, --findleaks       deprecated alias to --fail-env-changed

  -R RUNCOUNTS, --huntrleaks RUNCOUNTS
                        search for reference leaks (needs debug build, very slow). See the section at bottom
                        for more details.
msg405947 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2021-11-08 13:03
Thanks, I get that. My issue is with the apparent mismatch between the English meaning of "find leaks" and "fail env changed." It seems to me that the help message(s) for one or both of those options is probably incorrect and needs to be changed.
msg406055 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-11-09 21:52
That's probably why --findleaks was deprecated (in 3.8, PR12951).  We could remove it now. 

+ vstinner
msg406081 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-11-10 11:07
In Python 3.6, regrtest failed if --findleaks was used and gc.garbage was not empty after a test completed.

I modified regrtest to always run this check: --findleaks is now ignored.

But I also modified --findleaks to make it an alias to the --fail-env-changed option: non-zero exit code if a test fails with "ENV CHANGED" status.

I wrote PR 29514 to clarify the situation: remove --findleaks :-)
msg406082 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-11-10 11:08
To check for reference leaks, memory leaks and file descriptor leaks: --huntrleaks/-R should be used.
msg406218 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-11-12 15:19
New changeset 9d3271438431c37c29c359f5b73e8094b5f82912 by Victor Stinner in branch 'main':
bpo-45745: Remove regrtest --findleaks options (GH-29514)
https://github.com/python/cpython/commit/9d3271438431c37c29c359f5b73e8094b5f82912
History
Date User Action Args
2022-04-11 14:59:52adminsetgithub: 89908
2021-11-12 15:19:32vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-11-12 15:19:23vstinnersetmessages: + msg406218
2021-11-10 11:08:29vstinnersetmessages: + msg406082
2021-11-10 11:07:06vstinnersetmessages: + msg406081
2021-11-10 11:03:43vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request27766
2021-11-09 21:52:55iritkatrielsetnosy: + iritkatriel, vstinner
messages: + msg406055
2021-11-08 13:03:59skip.montanarosetmessages: + msg405947
2021-11-07 22:01:31Dennis Sweeneysetnosy: + Dennis Sweeney
messages: + msg405917
2021-11-07 21:39:17skip.montanarocreate