-
-
Notifications
You must be signed in to change notification settings - Fork 727
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
async... await in tests #3706
async... await in tests #3706
Conversation
Oh wow, this is amazing. Thank you @crusaderky ! |
port = a.http_server.port | ||
|
||
future = c.submit(sleep, 1) | ||
yield gen.sleep(0.1) | ||
await gen.sleep(0.1) |
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.
can gen.sleep also be replaced with asyncio.sleep ?
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, why not
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.
done!
I'm done, however travis is randomly failing. The failures are concentrated in (but not exclusive to) Python 3.6, and are completely random - run again, and they just move somewhere else. I can't reproduce them locally. For reviewers: since reading 2800 lines of changes can make your eyes cross, I presented the change in 3 commits:
|
Thanks again for doing this @crusaderky . This is great.
That's super thoughtful. Thanks!
Hrm, that looks frustrating. At first glance I don't know what's going on. Those do appear to be new intermittent failures though, so I suspect that they are related to some change here. There are some subtle differences between asyncio and tornado that can come up very rarely, like One rather unpleasant way to figure out what is going on is to do a binary search with CI. For example you could commit the changes in half of the files and see if CI keeps complaining. That is a really painful iteration cycle though. |
Fix regression in Python 3.6
Fix flaky tests Readd test
Ok I brought it down to two flaky tests.
Not sure what to do with either but I'm fairly convinced it's not my fault... |
See #3717 for one
|
|
Well great. In that case I'm +1 here. Any objection to merging @jrbourbeau ? |
should I mark them as xfail? |
Merging this in. Thanks again @crusaderky ! |
A bunch of An example test is the one below (link here):
Just from the looks of it, and by reading the comments here, upgrading from Python 3.6 and adding an But, even after making these changes, all Also note that I had to add Any help is appreciated since this is blocking another PR as well. |
@crusaderky do you have time to revert the check that causes these failures downstream? |
@mrocklin yes I will |
@chinmaychandak could you post the output of |
Does this help — https://travis-ci.org/github/python-streamz/streamz/builds/677897003? It shows a Linux platform with Python 3.8. |
@skip
markers for Python < 3.6Client(asynchronous=True).close()
that, if invoked twice, on the second round would returnNone
; it now returnsAwaitable[None]
.@gen_cluster
and@gen_test
now accept only async functions@gen_cluster
now properly waits for all Comm and Client objects to be closed, and crashes in case some keep lingering