[GCS] Fix actor task hang when its owner exits before local dependencies resolved (#8045)

This commit is contained in:
ZhuSenlin
2020-07-27 10:56:52 +08:00
committed by GitHub
parent f3fdb5c5db
commit a269ae9bc4
29 changed files with 871 additions and 236 deletions
+20
View File
@@ -8,6 +8,7 @@ try:
except ImportError:
pytest_timeout = None
import sys
import datetime
import ray
import ray.test_utils
@@ -816,5 +817,24 @@ def test_inherit_actor_from_class(ray_start_regular):
assert ray.get(actor.g.remote(5)) == 6
@pytest.mark.skip(
"This test is just used to print the latency of creating 100 actors.")
def test_actor_creation_latency(ray_start_regular):
# This test is just used to test the latency of actor creation.
@ray.remote
class Actor:
def get_value(self):
return 1
start = datetime.datetime.now()
actor_handles = [Actor.remote() for _ in range(100)]
actor_create_time = datetime.datetime.now()
for actor_handle in actor_handles:
ray.get(actor_handle.get_value.remote())
end = datetime.datetime.now()
print("actor_create_time_consume = {}, total_time_consume = {}".format(
actor_create_time - start, end - start))
if __name__ == "__main__":
sys.exit(pytest.main(["-v", __file__]))