mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 22:51:19 +08:00
Remove ray.tasks() from API. (#7807)
This commit is contained in:
@@ -167,6 +167,39 @@ print("success")
|
||||
assert "success" in out
|
||||
|
||||
|
||||
def test_cleanup_on_driver_exit(call_ray_start):
|
||||
# This test will create a driver that creates a bunch of objects and then
|
||||
# exits. The entries in the object table should be cleaned up.
|
||||
address = call_ray_start
|
||||
|
||||
ray.init(address=address)
|
||||
|
||||
# Define a driver that creates a bunch of objects and exits.
|
||||
driver_script = """
|
||||
import time
|
||||
import ray
|
||||
ray.init(address="{}")
|
||||
object_ids = [ray.put(i) for i in range(1000)]
|
||||
start_time = time.time()
|
||||
while time.time() - start_time < 30:
|
||||
if len(ray.objects()) == 1000:
|
||||
break
|
||||
else:
|
||||
raise Exception("Objects did not appear in object table.")
|
||||
print("success")
|
||||
""".format(address)
|
||||
|
||||
run_string_as_driver(driver_script)
|
||||
|
||||
# Make sure the objects are removed from the object table.
|
||||
start_time = time.time()
|
||||
while time.time() - start_time < 30:
|
||||
if len(ray.objects()) == 0:
|
||||
break
|
||||
else:
|
||||
raise Exception("Objects were not all removed from object table.")
|
||||
|
||||
|
||||
def test_drivers_named_actors(call_ray_start):
|
||||
# This test will create some drivers that submit some tasks to the same
|
||||
# named actor.
|
||||
|
||||
Reference in New Issue
Block a user