mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
[Serve] remove constants shorthands in tests (#24053)
This commit is contained in:
parent
47243ace7c
commit
22a6fafbb5
1 changed files with 5 additions and 10 deletions
|
@ -144,15 +144,8 @@ def test_replica_startup_status_transitions(ray_cluster):
|
|||
wait_for_condition(lambda: len(get_replicas(ReplicaState.STARTING)) > 0)
|
||||
replica = get_replicas(ReplicaState.STARTING)[0]
|
||||
|
||||
# FIXME: We switched our code formatter from YAPF to Black. Check whether we still
|
||||
# need shorthands and update the comment below. See issue #21318.
|
||||
# declare shorthands as yapf doesn't like long lambdas
|
||||
PENDING_ALLOCATION = ReplicaStartupStatus.PENDING_ALLOCATION
|
||||
PENDING_INITIALIZATION = ReplicaStartupStatus.PENDING_INITIALIZATION
|
||||
SUCCEEDED = ReplicaStartupStatus.SUCCEEDED
|
||||
|
||||
# currently there are no resources to allocate the replica
|
||||
assert replica.check_started() == PENDING_ALLOCATION
|
||||
assert replica.check_started() == ReplicaStartupStatus.PENDING_ALLOCATION
|
||||
|
||||
# add the necessary resources to allocate the replica
|
||||
cluster.add_node(num_cpus=4)
|
||||
|
@ -162,13 +155,15 @@ def test_replica_startup_status_transitions(ray_cluster):
|
|||
def is_replica_pending_initialization():
|
||||
status = replica.check_started()
|
||||
print(status)
|
||||
return status == PENDING_INITIALIZATION
|
||||
return status == ReplicaStartupStatus.PENDING_INITIALIZATION
|
||||
|
||||
wait_for_condition(is_replica_pending_initialization, timeout=25)
|
||||
|
||||
# send signal to complete replica intialization
|
||||
signal.send.remote()
|
||||
wait_for_condition(lambda: replica.check_started() == SUCCEEDED)
|
||||
wait_for_condition(
|
||||
lambda: replica.check_started() == ReplicaStartupStatus.SUCCEEDED
|
||||
)
|
||||
|
||||
|
||||
def test_intelligent_scale_down(ray_cluster):
|
||||
|
|
Loading…
Add table
Reference in a new issue