Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase #91260
Copy link
Copy link
Closed
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixestestsTests in the Lib/test dirTests in the Lib/test dirtopic-asyncio
Description
Activity
- added3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixestestsTests in the Lib/test dirTests in the Lib/test dir
on Mar 23, 2022 2 remaining items
I forgot to specify, that this is *only* on 3.10, not main.
The test is failing on GH Actions too on 3.10 branch, it should be reverted until a fix is found.
See #91667
Using
python -m test.bisect_cmd test_asyncio --fail-env-changedin 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:020: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>}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_helperwhich the test_asyncio.test_threads code no longer calls. from CI run https://github.com/python/cpython/runs/6069450575?check_suite_focus=truetracked in #91676 now as this issue's PR is merely a tickler of a latent problem, not the cause.
Closing as it is now tracked in #91676
Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixestestsTests in the Lib/test dirTests in the Lib/test dirtopic-asyncio
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:
bugs.python.org fields: