-
-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -297,3 +297,19 @@ def f(): | |
|
|
||
| result = yield c.submit(f) | ||
| assert result | ||
|
|
||
|
|
||
| @gen_cluster() | ||
| def test_submit_different_names(s, a, b): | ||
| # https://github.com/dask/distributed/issues/2058 | ||
| da = pytest.importorskip('dask.array') | ||
| c = yield Client('localhost:' + s.address.split(":")[-1], loop=s.loop, | ||
| asynchronous=True) | ||
| try: | ||
| X = c.persist(da.random.uniform(size=(100, 10), chunks=50)) | ||
| yield wait(X) | ||
|
|
||
| fut = yield c.submit(lambda x: x.sum().compute(), X) | ||
| assert fut > 0 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| finally: | ||
| yield c.close() | ||
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()overc.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