Restore context on listen in UVStreamServer. Fix #305#306
Restore context on listen in UVStreamServer. Fix #305#306versusvoid wants to merge 1 commit intoMagicStack:masterfrom versusvoid:issue-305
Conversation
fantix
left a comment
There was a problem hiding this comment.
Other than the unstable test issue, I'm okay with this PR. Thanks!
tests/test_context.py
Outdated
| # Let all transports shutdown. | ||
| await asyncio.sleep(0.1) |
There was a problem hiding this comment.
Using sleep is generally not recommended for new tests in uvloop - this test is actually unstable, I could get a false OK if the srv.close() got called before the connection is fully established.
A proper fix is to use a Future, set in factory() and awaited in test() - we could even pass over the assertion error in this manner. With this fix, the ResourceWarning is also gone.
fantix
left a comment
There was a problem hiding this comment.
Please see suggested changes below - could you please also rebase your commits to latest master so that the test suite may pass? Thanks!
|
This particular fix is OK, but we need to fix this for all other "native" callbacks in uvloop in a more systematic way. |
|
Merged in #348. Thanks for the PR! |
No description provided.