mirror of
https://github.com/wassname/ray.git
synced 2026-07-29 11:26:04 +08:00
[Core] Multi-tenancy: enable multi-tenancy by default (#10570)
* Add new job in Travis to enable multi-tenancy * fix * Update .bazelrc * Update .travis.yml * fix test_job_gc_with_detached_actor * fix test_multiple_downstream_tasks * fix lint * Enable multi-tenancy by default * Kill idle workers in FIFO order * Update test * minor update * Address comments * fix some cases * fix test_remote_cancel * Address comments * fix after merge * remove kill * fix worker_pool_test * fix java test timeout * fix test_two_custom_resources * Add a delay when killing idle workers * fix test_worker_failure * fix test_worker_failed again * fix DisconnectWorker * update test_worker_failed * Revert some python tests * lint * address comments
This commit is contained in:
@@ -11,7 +11,10 @@ import ray
|
||||
import ray.cluster_utils
|
||||
import ray.test_utils
|
||||
|
||||
from ray.test_utils import RayTestTimeoutException
|
||||
from ray.test_utils import (
|
||||
RayTestTimeoutException,
|
||||
wait_for_condition,
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -505,6 +508,17 @@ def test_two_custom_resources(ray_start_cluster):
|
||||
})
|
||||
ray.init(address=cluster.address)
|
||||
|
||||
@ray.remote
|
||||
def foo():
|
||||
# Sleep a while to emulate a slow operation. This is needed to make
|
||||
# sure tasks are scheduled to different nodes.
|
||||
time.sleep(0.1)
|
||||
return ray.worker.global_worker.node.unique_id
|
||||
|
||||
# Make sure each node has at least one idle worker.
|
||||
wait_for_condition(
|
||||
lambda: len(set(ray.get([foo.remote() for _ in range(6)]))) == 2)
|
||||
|
||||
@ray.remote(resources={"CustomResource1": 1})
|
||||
def f():
|
||||
time.sleep(0.001)
|
||||
|
||||
Reference in New Issue
Block a user