mirror of
https://github.com/wassname/ray.git
synced 2026-07-22 13:00:49 +08:00
[Dashboard] Fix and Recommit Reverted Group by Actor Class PR (#10186)
* Revert "Revert "[Dashboard] Group by Actor Class (#10147)" (#10180)"
This reverts commit e4d2ca620a.
* Fix metrics test to agree with the new logical view API
* lint2
Co-authored-by: Max Fitton <max@semprehealth.com>
This commit is contained in:
@@ -206,14 +206,15 @@ def test_raylet_info_endpoint(shutdown_only):
|
||||
except Exception as ex:
|
||||
print("failed response: {}".format(response.text))
|
||||
raise ex
|
||||
actor_info = raylet_info["result"]["actors"]
|
||||
actors_info = raylet_info["result"]["actors"]
|
||||
try:
|
||||
assert len(actor_info) == 1
|
||||
_, parent_actor_info = actor_info.popitem()
|
||||
assert parent_actor_info["numObjectRefsInScope"] == 13
|
||||
assert parent_actor_info["numLocalObjects"] == 10
|
||||
children = parent_actor_info["children"]
|
||||
assert len(children) == 2
|
||||
assert len(actors_info) == 3
|
||||
c_actor_info = [
|
||||
actor for actor in actors_info.values()
|
||||
if "ActorC" in actor["actorTitle"]
|
||||
][0]
|
||||
assert c_actor_info["numObjectRefsInScope"] == 13
|
||||
assert c_actor_info["numLocalObjects"] == 10
|
||||
break
|
||||
except AssertionError:
|
||||
if time.time() > start_time + 30:
|
||||
@@ -230,16 +231,8 @@ def test_raylet_info_endpoint(shutdown_only):
|
||||
cpu_resources += slot["allocation"]
|
||||
return cpu_resources
|
||||
|
||||
assert cpu_resources(parent_actor_info) == 2
|
||||
assert parent_actor_info["numExecutedTasks"] == 4
|
||||
for _, child_actor_info in children.items():
|
||||
if child_actor_info["state"] == -1:
|
||||
assert child_actor_info["requiredResources"]["CustomResource"] == 1
|
||||
else:
|
||||
assert child_actor_info[
|
||||
"state"] == ray.gcs_utils.ActorTableData.ALIVE
|
||||
assert len(child_actor_info["children"]) == 0
|
||||
assert cpu_resources(child_actor_info) == 1
|
||||
assert cpu_resources(c_actor_info) == 2
|
||||
assert c_actor_info["numExecutedTasks"] == 4
|
||||
|
||||
profiling_id = requests.get(
|
||||
webui_url + "/api/launch_profiling",
|
||||
@@ -329,26 +322,12 @@ def test_raylet_pending_tasks(shutdown_only):
|
||||
actor_info = raylet_info["result"]["actors"]
|
||||
assert len(actor_info) == 1
|
||||
_, infeasible_actor_info = actor_info.popitem()
|
||||
|
||||
# Verify there are 4 spawned actors.
|
||||
children = infeasible_actor_info["children"]
|
||||
assert len(children) == 4
|
||||
|
||||
pending_actor_detected = 0
|
||||
for child_id, child in children.items():
|
||||
if ("invalidStateType" in child
|
||||
and child["invalidStateType"] == "pendingActor"):
|
||||
pending_actor_detected += 1
|
||||
# 4 GPUActors are spawned although there are only 3 GPUs.
|
||||
# One actor should be in the pending state.
|
||||
assert pending_actor_detected == 1
|
||||
|
||||
assert (wait_until_succeeded_without_exception(
|
||||
test_pending_actor,
|
||||
(AssertionError, requests.exceptions.ConnectionError),
|
||||
addresses,
|
||||
timeout_ms=30000,
|
||||
retry_interval_ms=1000) is True)
|
||||
wait_until_succeeded_without_exception(
|
||||
test_pending_actor,
|
||||
(AssertionError, requests.exceptions.ConnectionError),
|
||||
addresses,
|
||||
timeout_ms=30000,
|
||||
retry_interval_ms=1000)
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
|
||||
Reference in New Issue
Block a user