[autoscaler] Fix test heartbeats single test (#12513)

* update

* update

* update
This commit is contained in:
Eric Liang 2020-11-30 21:24:45 -08:00 committed by GitHub
parent 16ca748454
commit fd8ae0697b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}))