mirror of
https://github.com/wassname/ray.git
synced 2026-07-16 11:21:10 +08:00
[GCS] Fix actor task hang when its owner exits before local dependencies resolved (#8045)
This commit is contained in:
@@ -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__]))
|
||||
|
||||
Reference in New Issue
Block a user