mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 20:00:22 +08:00
[Tests] Make test_multi_driver light. (#10086)
This commit is contained in:
@@ -44,6 +44,7 @@ def test_initial_workers(shutdown_only):
|
||||
# of different jobs were not correctly isolated during execution.
|
||||
def test_multi_drivers(shutdown_only):
|
||||
info = ray.init(
|
||||
num_cpus=10,
|
||||
_internal_config=json.dumps({
|
||||
"enable_multi_tenancy": True
|
||||
}))
|
||||
@@ -67,9 +68,9 @@ def get_pid():
|
||||
|
||||
pid_objs = []
|
||||
# Submit some normal tasks and get the PIDs of workers which execute the tasks.
|
||||
pid_objs = pid_objs + [get_pid.remote() for _ in range(5)]
|
||||
pid_objs = pid_objs + [get_pid.remote() for _ in range(2)]
|
||||
# Create some actors and get the PIDs of actors.
|
||||
actors = [Actor.remote() for _ in range(5)]
|
||||
actors = [Actor.remote() for _ in range(2)]
|
||||
pid_objs = pid_objs + [actor.get_pid.remote() for actor in actors]
|
||||
|
||||
pids = set([ray.get(obj) for obj in pid_objs])
|
||||
@@ -79,7 +80,7 @@ print("PID:" + str.join(",", [str(_) for _ in pids]))
|
||||
ray.shutdown()
|
||||
""".format(info["redis_address"])
|
||||
|
||||
driver_count = 10
|
||||
driver_count = 3
|
||||
processes = [
|
||||
run_string_as_driver_nonblocking(driver_code)
|
||||
for _ in range(driver_count)
|
||||
|
||||
Reference in New Issue
Block a user