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

warning of threading_cleanup in test_threading #74572

Closed
zhangyangyu opened this issue May 17, 2017 · 10 comments
Closed

warning of threading_cleanup in test_threading #74572

zhangyangyu opened this issue May 17, 2017 · 10 comments
Labels
3.7 (EOL) end of life tests Tests in the Lib/test dir

Comments

@zhangyangyu
Copy link
Member

BPO 30387
Nosy @vstinner, @zhangyangyu
PRs
  • bpo-30387: Fix warning in test_threading #1634
  • [3.6] bpo-30387: Fix warning in test_threading (#1634) #1636
  • [3.5] bpo-30387: Fix warning in test_threading (#1634) #1637
  • 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 2017-05-17.22:39:17.383>
    created_at = <Date 2017-05-17.15:01:59.068>
    labels = ['3.7', 'tests']
    title = 'warning of threading_cleanup in test_threading'
    updated_at = <Date 2017-05-17.22:39:17.381>
    user = 'https://github.com/zhangyangyu'

    bugs.python.org fields:

    activity = <Date 2017-05-17.22:39:17.381>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-05-17.22:39:17.383>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2017-05-17.15:01:59.068>
    creator = 'xiang.zhang'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30387
    keywords = []
    message_count = 10.0
    messages = ['293857', '293867', '293868', '293869', '293871', '293875', '293878', '293890', '293892', '293900']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'xiang.zhang']
    pr_nums = ['1634', '1636', '1637']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue30387'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    @zhangyangyu
    Copy link
    Member Author

    Running test_threading throws a warning now.

    ./python -m test test_threading
    Run tests sequentially
    0:00:00 load avg: 0.22 [1/1] test_threading
    Warning -- threading_cleanup() failed to cleanup 0 threads after 2 sec (count: 0, dangling: 21)
    1 test OK.

    Total duration: 13 sec
    Tests result: SUCCESS

    Seems related to 79ef7f8.

    @zhangyangyu zhangyangyu added the tests Tests in the Lib/test dir label May 17, 2017
    @vstinner
    Copy link
    Member

    What is your OS? On which Python version?

    @vstinner
    Copy link
    Member

    Seems related to 79ef7f8.

    That's bpo-30357.

    It's just that before test_threaindg "leaked" tests but there was no warning. Getting a warning is a good thing, it means that we have a bug that it must be fixed ;-)

    @vstinner
    Copy link
    Member

    Oh wait, I succeeded to reproduce the bug on master. In verbose mode, we even get the test name!

    test_is_alive_after_fork (test.test_threading.ThreadTests) ... Warning -- threading_cleanup() failed to cleanup 0 threads after 3 sec (count: 0, dangling: 21)
    ok

    @vstinner
    Copy link
    Member

    #1634 fixes the
    test_is_alive_after_fork() warning on Linux.

    @vstinner
    Copy link
    Member

    New changeset f8d05b3 by Victor Stinner in branch 'master':
    bpo-30387: Fix warning in test_threading (bpo-1634)
    f8d05b3

    @vstinner
    Copy link
    Member

    Oh, strange, the test in Python 2.7 doesn't have the bug: see commit 30a5445. Compare it to the code in Python 3: commit 9939cc8.

    The warning is already fixed in master. I created backports for 3.5 and 3.6.

    @vstinner vstinner added the 3.7 (EOL) end of life label May 17, 2017
    @vstinner
    Copy link
    Member

    New changeset 44944b6 by Victor Stinner in branch '3.6':
    bpo-30387: Fix warning in test_threading (bpo-1634) (bpo-1636)
    44944b6

    @vstinner
    Copy link
    Member

    New changeset f5633e0 by Victor Stinner in branch '3.5':
    bpo-30387: Fix warning in test_threading (bpo-1634) (bpo-1637)
    f5633e0

    @vstinner
    Copy link
    Member

    Ok, the warning should now be fixed. Thanks for the report Xiang. I don't know how I missed it ;-)

    @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.7 (EOL) end of life tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants