mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 10:49:16 +08:00
Add regression test for actor load balancing (#5224)
* Add regression test for actor load balancing * Increase timeout * Reduce number of nodes?
This commit is contained in:
@@ -905,6 +905,30 @@ def test_actor_load_balancing(ray_start_cluster):
|
||||
ray.get(results)
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
pytest_timeout is None,
|
||||
reason="Timeout package not installed; skipping test that may hang.")
|
||||
@pytest.mark.timeout(10)
|
||||
def test_actor_lifetime_load_balancing(ray_start_cluster):
|
||||
cluster = ray_start_cluster
|
||||
cluster.add_node(num_cpus=0)
|
||||
num_nodes = 3
|
||||
for i in range(num_nodes):
|
||||
cluster.add_node(num_cpus=1)
|
||||
ray.init(redis_address=cluster.redis_address)
|
||||
|
||||
@ray.remote(num_cpus=1)
|
||||
class Actor(object):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def ping(self):
|
||||
return
|
||||
|
||||
actors = [Actor.remote() for _ in range(num_nodes)]
|
||||
ray.get([actor.ping.remote() for actor in actors])
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
os.environ.get("RAY_USE_NEW_GCS") == "on",
|
||||
reason="Failing with new GCS API on Linux.")
|
||||
|
||||
Reference in New Issue
Block a user