Skip to content
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

close client in sync test_actor tests #6459

Merged
merged 1 commit into from
May 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions distributed/tests/test_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,7 @@ class UsesCounter:
def do_inc(self, ac):
return ac.increment().result()

with cluster(nworkers=1) as (cl, _):
client = Client(cl["address"])
with cluster(nworkers=1) as (cl, _), Client(cl["address"]) as client:
ac = client.submit(Counter, actor=True).result()
ac2 = client.submit(UsesCounter, actor=True).result()

Expand All @@ -652,8 +651,7 @@ def do_inc(self, ac):
# cannot expire
return ac.increment().result(timeout=0.001)

with cluster(nworkers=1) as (cl, _):
client = Client(cl["address"])
with cluster(nworkers=1) as (cl, _), Client(cl["address"]) as client:
ac = client.submit(Counter, actor=True).result()
ac2 = client.submit(UsesCounter, actor=True).result()

Expand All @@ -667,8 +665,7 @@ class UsesCounter:
def do_inc(self, ac):
return get_client().sync(ac.increment)

with cluster(nworkers=1) as (cl, _):
client = Client(cl["address"])
with cluster(nworkers=1) as (cl, _), Client(cl["address"]) as client:
ac = client.submit(Counter, actor=True).result()
ac2 = client.submit(UsesCounter, actor=True).result()

Expand Down Expand Up @@ -701,8 +698,7 @@ def method(self):
def prop(self):
raise MyException

with cluster(nworkers=2) as (cl, w):
client = Client(cl["address"])
with cluster(nworkers=2) as (cl, w), Client(cl["address"]) as client:
ac = client.submit(Broken, actor=True).result()
acfut = ac.method()
with pytest.raises(MyException):
Expand Down