Skip to content

Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase #91260

Description

@asvetlov
BPO 47104
Nosy @asvetlov, @1st1, @miss-islington, @Fidget-Spinner
PRs
  • bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase #32086
  • [3.10] bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase (GH-32086) #32087
  • [3.9] bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase (GH-32086) #32088
  • 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 = None
    created_at = <Date 2022-03-23.20:42:40.140>
    labels = ['3.11', 'tests', '3.10', 'expert-asyncio']
    title = 'Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase'
    updated_at = <Date 2022-04-06.17:56:00.892>
    user = 'https://github.com/asvetlov'

    bugs.python.org fields:

    activity = <Date 2022-04-06.17:56:00.892>
    actor = 'kj'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Tests', 'asyncio']
    creation = <Date 2022-03-23.20:42:40.140>
    creator = 'asvetlov'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 47104
    keywords = ['patch']
    message_count = 4.0
    messages = ['415913', '415914', '416890', '416893']
    nosy_count = 4.0
    nosy_names = ['asvetlov', 'yselivanov', 'miss-islington', 'kj']
    pr_nums = ['32086', '32087', '32088']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue47104'
    versions = ['Python 3.10', 'Python 3.11']

    Activity

    1. asvetlov commented on Mar 23, 2022

      @asvetlov
      ContributorAuthor

      New changeset ff619c7 by Andrew Svetlov in branch 'main':
      bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase (GH-32086)
      ff619c7

    2. miss-islington commented on Mar 23, 2022

      @miss-islington
      Contributor

      New changeset 9e1bfd8 by Miss Islington (bot) in branch '3.10':
      bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase (GH-32086)
      9e1bfd8

    3. 2 remaining items

    4. Fidget-Spinner commented on Apr 6, 2022

      @Fidget-Spinner
      Member

      I forgot to specify, that this is *only* on 3.10, not main.

    5. transferred this issue fromon Apr 10, 2022
    6. kumaraditya303 commented on Apr 18, 2022

      @kumaraditya303
      Contributor

      The test is failing on GH Actions too on 3.10 branch, it should be reverted until a fix is found.

      See #91667

    7. gpshead commented on Apr 18, 2022

      @gpshead
      Member

      Using python -m test.bisect_cmd test_asyncio --fail-env-changed in a 3.10 build I got:

      == Tests result: ENV CHANGED ==
      
      1 test altered the execution environment:
          test_asyncio
      
      Total duration: 2.7 sec
      Tests result: ENV CHANGED
      ran 2 tests/4
      exit 3
      Tests failed: continuing with this subtest
      
      Tests (2):
      * test.test_asyncio.test_threads.ToThreadTests.test_to_thread_concurrent
      * test.test_asyncio.test_unix_events.SelectorEventLoopSignalTests.test_add_signal_handler
      
      Bisection failed after 101 iterations and 0:04:02
      
    8. gpshead commented on Apr 18, 2022

      @gpshead
      Member
      0:00:00 load avg: 0.93 [1/2/1] test_asyncio.test_threads failed (env changed)
      Warning -- threading._dangling was modified by test_asyncio.test_threads
        Before: {<weakref at 0x7f3b2e77fa10; to '_MainThread' at 0x7f3b2f107490>}
        After:  {<weakref at 0x7f3b2e77ffb0; to '_MainThread' at 0x7f3b2f107490>}
      
    9. gpshead commented on Apr 18, 2022

      @gpshead
      Member

      I don't think this PR is the cause, just a code tweak that causes it to be exposed more often. Other tests lead to

      0:09:20 load avg: 1.49 [427/427/1] test_asyncio failed (env changed) (1 min 22 sec)
      Warning -- threading_cleanup() failed to cleanup -1 threads (count: 0, dangling: 1)
      Warning -- Dangling thread: <_MainThread(MainThread, started 140300013757632)>
      

      which is an environment change warning codepath from test.support.threading_helper which the test_asyncio.test_threads code no longer calls. from CI run https://github.com/python/cpython/runs/6069450575?check_suite_focus=true

    10. gpshead commented on Apr 18, 2022

      @gpshead
      Member

      tracked in #91676 now as this issue's PR is merely a tickler of a latent problem, not the cause.

    11. added a commit that references this issue on Apr 19, 2022
    12. added a commit that references this issue on Apr 19, 2022
    13. kumaraditya303 commented on Apr 19, 2022

      @kumaraditya303
      Contributor

      Closing as it is now tracked in #91676

    14. added a commit that references this issue on Apr 19, 2022
    15. added a commit that references this issue on Jun 2, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions