-
-
Notifications
You must be signed in to change notification settings - Fork 748
BUG: Normalize address before comparison #2066
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
Conversation
|
cc @mrocklin The test is good, but I'm not sure if this is the appropriate fix or not. My idea was to always normalize user-provided If you like the fix, then I'll go through |
|
I don't have strong thoughts about how this could backfire. @pitrou is the expert here. I'm inclined to go ahead with it if the test suite doesn't complain. |
|
I notice that other places accepting an |
|
The windows failure is interesting. I haven't seen it before and may be related? I'm not sure. |
| yield wait(X) | ||
|
|
||
| fut = yield c.submit(lambda x: x.sum().compute(), X) | ||
| assert fut > 0 |
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.
I recommend avoiding the use of the normal context manager in async tests. If you were to use async with c that would work well, but we can't use that within tests that have to be within python 2 friendly files. Instead I recommend using try/finally.
Also, if you're not going to use the client created in the gen_cluster decorator then you probably want the following:
@gen_cluster()
def test_foo(s, a, b):
c = yield Client(...)
try:
...
finally:
yield c.close()There are also some examples of this in test_client.py
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.
OK, thanks. I was just using the context manager so that it was cleaned up.
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.
Understood, but the context manager is synchronous API. There is no way for us to yield c.close() within the normal context mananger. I think that it just starts the close coroutine, but doesn't wait for it. You'll either need to use async with or explicitly call c.close() to be sure that it closes up.
|
Agreed that the windows test could be related. I'll see if it fails this time around. |
|
Windows passed this time. The Python 2 travis run failed: https://travis-ci.org/dask/distributed/jobs/394751774#L1637 |
| asynchronous=True) | ||
| try: | ||
| X = c.persist(da.random.uniform(size=(100, 10), chunks=50)) | ||
| yield wait(X) |
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.
Fine for now, but in the future I recommend foo.persist() over c.persist(foo)
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.
Just for aesthetic reasons really
Closes #2058