Skip to content

Commit

Permalink
Fix ray get in related unit tests (intel-analytics#1985)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkvision committed Feb 14, 2020
1 parent 35e6560 commit 7d3790e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def network(self):


actors = [TestRay.remote() for i in range(0, slave_num)]
print([ray.get(actor.hostname.remote()) for actor in actors])
print([ray.get(actor.ip.remote()) for actor in actors])
# print([ray.get(actor.network.remote()) for actor in actors])
print(ray.get([actor.hostname.remote() for actor in actors]))
print(ray.get([actor.ip.remote() for actor in actors]))
# print(ray.get([actor.network.remote() for actor in actors]))

ray_ctx.stop()
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ def hostname(self):
ray_ctx = RayContext(sc=sc, object_store_memory="2g")
ray_ctx.init()
actors = [TestRay.remote() for i in range(0, node_num)]
print([ray.get(actor.hostname.remote()) for actor in actors])
print(ray.get([actor.hostname.remote() for actor in actors]))
ray_ctx.stop()
# repeat
ray_ctx = RayContext(sc=sc, object_store_memory="1g")
ray_ctx.init()
actors = [TestRay.remote() for i in range(0, node_num)]
print([ray.get(actor.hostname.remote()) for actor in actors])
print(ray.get([actor.hostname.remote() for actor in actors]))
ray_ctx.stop()

sc.stop()
Expand Down
2 changes: 1 addition & 1 deletion python/orca/src/test/bigdl/orca/ray/test_ray_on_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_local(self):
ray_ctx = RayContext(sc=sc, object_store_memory="1g")
ray_ctx.init()
actors = [TestRay.remote() for i in range(0, node_num)]
print([ray.get(actor.hostname.remote()) for actor in actors])
print(ray.get([actor.hostname.remote() for actor in actors]))
ray_ctx.stop()
sc.stop()
time.sleep(1)
Expand Down
4 changes: 2 additions & 2 deletions python/orca/src/test/bigdl/orca/ray/test_reinit_raycontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ def test_local(self):
ray_ctx = RayContext(sc=sc, object_store_memory="1g")
ray_ctx.init()
actors = [TestRay.remote() for i in range(0, node_num)]
print([ray.get(actor.hostname.remote()) for actor in actors])
print(ray.get([actor.hostname.remote() for actor in actors]))
ray_ctx.stop()
time.sleep(3)
# repeat
print("-------------------first repeat begin!------------------")
ray_ctx = RayContext(sc=sc, object_store_memory="1g")
ray_ctx.init()
actors = [TestRay.remote() for i in range(0, node_num)]
print([ray.get(actor.hostname.remote()) for actor in actors])
print(ray.get([actor.hostname.remote() for actor in actors]))
ray_ctx.stop()
sc.stop()
time.sleep(3)
Expand Down

0 comments on commit 7d3790e

Please sign in to comment.