mirror of
https://github.com/vale981/ray
synced 2025-03-08 11:31:40 -05:00
[autoscaler] Fix test heartbeats single test (#12513)
* update * update * update
This commit is contained in:
parent
16ca748454
commit
fd8ae0697b
1 changed files with 3 additions and 4 deletions
|
@ -6,8 +6,7 @@ import ray
|
|||
import ray.ray_constants as ray_constants
|
||||
from ray.monitor import Monitor
|
||||
from ray.cluster_utils import Cluster
|
||||
from ray.test_utils import generate_system_config_map, SignalActor, \
|
||||
new_scheduler_enabled
|
||||
from ray.test_utils import generate_system_config_map, SignalActor
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -118,7 +117,6 @@ def verify_load_metrics(monitor, expected_resource_usage=None, timeout=30):
|
|||
"num_cpus": 2,
|
||||
}],
|
||||
indirect=True)
|
||||
@pytest.mark.skipif(new_scheduler_enabled(), reason="fails in travis?")
|
||||
def test_heartbeats_single(ray_start_cluster_head):
|
||||
"""Unit test for `Cluster.wait_for_nodes`.
|
||||
|
||||
|
@ -146,7 +144,7 @@ def test_heartbeats_single(ray_start_cluster_head):
|
|||
ray.get(signal.send.remote())
|
||||
ray.get(work_handle)
|
||||
|
||||
@ray.remote
|
||||
@ray.remote(num_cpus=1)
|
||||
class Actor:
|
||||
def work(self, signal):
|
||||
wait_signal = signal.wait.remote()
|
||||
|
@ -160,6 +158,7 @@ def test_heartbeats_single(ray_start_cluster_head):
|
|||
|
||||
test_actor = Actor.remote()
|
||||
work_handle = test_actor.work.remote(signal)
|
||||
time.sleep(1) # Time for actor to get placed and the method to start.
|
||||
|
||||
verify_load_metrics(monitor, ({"CPU": 1.0}, {"CPU": total_cpus}))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue