-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Bring trio-asyncio into the next decade #66
Conversation
Sigh, and of course the CI python versions are too old for these tests now. Seems like we should probably try to collect tests from the installed Python, rather than vendoring them. We can have a list of which need to add skip/xfail markers for which Python version. I'll try that approach next. |
Codecov Report
@@ Coverage Diff @@
## next #66 +/- ##
=========================================
- Coverage 73.4% 72.66% -0.74%
=========================================
Files 11 11
Lines 1267 1284 +17
Branches 166 177 +11
=========================================
+ Hits 930 933 +3
+ Misses 282 281 -1
- Partials 55 70 +15
|
Down to 7 failing tests on py3.7, and one on py3.6. (This is without copying the skip/xfail markers from the previous set of vendored tests, except for one.) The greenlet-based SyncTrioEventLoop is kind of evil, to be sure, but I found it to work a lot more reliably than the threading-based one. |
Using greenlet instead of thread is a great idea, should help a lot. |
- Update asyncio tests for Python 3.6.10 - Don't refer to trio.hazmat.Task._cancel_stack in interop tests - Don't use deprecated trio.Event.clear - Launch threads with trio.to_thread.run_sync 3.6.10 passes tests locally; 3.7.5 still has some issues.
…monkeypatching strategy
… thread; tests pass locally on 3.6 and 3.7
I think the greenlet direction is a good one to explore, but it was cluttering this diff too much, and ideally we'd have Trio support for it so we don't have to muck with Trio internals so much. Will revisit at a later time. This passes 3.8 for me now locally. |
…deprecation ignores aren't superseded
# fine with a greenlet-based sync loop) | ||
skip("test_base_events.py::RunningLoopTests::test_running_loop_within_a_loop") | ||
|
||
# Remainder of these have unclear issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we open any issues to track these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - #67
@@ -92,7 +92,7 @@ else | |||
mkdir empty | |||
cd empty | |||
|
|||
pytest -W error -ra -v --cov=trio_asyncio --cov-config=../.coveragerc --verbose ../tests | |||
pytest -ra -v --cov=trio_asyncio --cov-config=../.coveragerc --verbose ../tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes -- I created a pytest.ini with a more detailed warnings filter. (The loop= argument is deprecated in several asyncio methods on 3.8+. I didn't think it advisable to remove support for passing the loop just yet.)
Just tested
|
In the pre-merged version, as noted by #63 I was able to work around this by running:
In the top |
Thanks for the heads-up @parity3! I'll still be on py37 for the next several months but I'll keep this in mind for when I make the transition to py38! |
A collection of changes to make CI pass, including on 3.8.
Fix use of deprecated Trio features:
Collect Python stdlib asyncio tests from the installed stdlib, rather than trying to vendor them. This lets us run the tests on far more platforms.
Ignore some asyncio deprecation warnings on 3.8 for now.
Clean up the monkeypatching of asyncio event loop and event loop policy accessors. The primary functional changes are:
Improve SyncTrioEventLoop to not leak threads so much.