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

./python -m test --help output for refleaks seems wrong #89908

Closed
smontanaro opened this issue Nov 7, 2021 · 7 comments
Closed

./python -m test --help output for refleaks seems wrong #89908

smontanaro opened this issue Nov 7, 2021 · 7 comments
Labels
3.11 only security fixes build The build process and cross-build

Comments

@smontanaro
Copy link
Contributor

BPO 45745
Nosy @smontanaro, @vstinner, @sweeneyde, @iritkatriel
PRs
  • bpo-45745: Remove regrtest --findleaks options #29514
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-11-12.15:19:32.803>
    created_at = <Date 2021-11-07.21:39:17.463>
    labels = ['build', '3.11']
    title = './python -m test --help output for refleaks seems wrong'
    updated_at = <Date 2021-11-12.15:19:32.803>
    user = 'https://github.com/smontanaro'

    bugs.python.org fields:

    activity = <Date 2021-11-12.15:19:32.803>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-11-12.15:19:32.803>
    closer = 'vstinner'
    components = ['Build']
    creation = <Date 2021-11-07.21:39:17.463>
    creator = 'skip.montanaro'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45745
    keywords = ['patch']
    message_count = 7.0
    messages = ['405916', '405917', '405947', '406055', '406081', '406082', '406218']
    nosy_count = 4.0
    nosy_names = ['skip.montanaro', 'vstinner', 'Dennis Sweeney', 'iritkatriel']
    pr_nums = ['29514']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue45745'
    versions = ['Python 3.11']

    @smontanaro
    Copy link
    Contributor Author

    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?

    @smontanaro smontanaro added 3.11 only security fixes build The build process and cross-build labels Nov 7, 2021
    @sweeneyde
    Copy link
    Member

    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.

    @smontanaro
    Copy link
    Contributor Author

    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.

    @iritkatriel
    Copy link
    Member

    That's probably why --findleaks was deprecated (in 3.8, PR12951). We could remove it now.

    + vstinner

    @vstinner
    Copy link
    Member

    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 :-)

    @vstinner
    Copy link
    Member

    To check for reference leaks, memory leaks and file descriptor leaks: --huntrleaks/-R should be used.

    @vstinner
    Copy link
    Member

    New changeset 9d32714 by Victor Stinner in branch 'main':
    bpo-45745: Remove regrtest --findleaks options (GH-29514)
    9d32714

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes build The build process and cross-build
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants