Skip to content

Commit

Permalink
[Dashboard][Bug] Fix duplicate node total rows in dashboard (#12410)
Browse files Browse the repository at this point in the history
* Fix duplicate node total rows in dashboard by changing the react key of the NodeTotalRow component from the node IP to the node ID (node IP can be duplicated in the case of docker).

* simplify a piece of test code and fix a flaky time out

* lint
  • Loading branch information
mfitton authored Dec 1, 2020
1 parent e422ace commit 2708b3a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const makeGroupedTableContents = (
);
return (
<NodeRowGroup
key={node.ip}
key={node.raylet.nodeId}
node={node}
workerFeatureData={sortedClusterWorkers}
features={nodeInfoFeatures}
Expand Down
36 changes: 14 additions & 22 deletions dashboard/tests/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@
import requests

from ray import ray_constants
from ray.test_utils import (
format_web_url,
wait_for_condition,
wait_until_server_available,
run_string_as_driver,
)
from ray.test_utils import (format_web_url, wait_for_condition,
wait_until_server_available, run_string_as_driver,
wait_until_succeeded_without_exception)
from ray.autoscaler._private.util import (DEBUG_AUTOSCALING_STATUS,
DEBUG_AUTOSCALING_ERROR)
import ray.new_dashboard.consts as dashboard_consts
Expand Down Expand Up @@ -453,22 +450,17 @@ def test_get_cluster_status(ray_start_with_dashboard):

# Check that the cluster_status endpoint works without the underlying data
# from the GCS, but returns nothing.
last_exception = None
for _ in range(5):
try:
response = requests.get(f"{webui_url}/api/cluster_status")
response.raise_for_status()
assert response.json()["result"]
assert "autoscalingStatus" in response.json()["data"]
assert response.json()["data"]["autoscalingStatus"] is None
assert "autoscalingError" in response.json()["data"]
assert response.json()["data"]["autoscalingError"] is None
break
except requests.RequestException as e:
last_exception = e
time.sleep(1)
else:
raise last_exception
def get_cluster_status():
response = requests.get(f"{webui_url}/api/cluster_status")
response.raise_for_status()
assert response.json()["result"]
assert "autoscalingStatus" in response.json()["data"]
assert response.json()["data"]["autoscalingStatus"] is None
assert "autoscalingError" in response.json()["data"]
assert response.json()["data"]["autoscalingError"] is None

wait_until_succeeded_without_exception(get_cluster_status,
(requests.RequestException, ))

# Populate the GCS field, check that the data is returned from the
# endpoint.
Expand Down

0 comments on commit 2708b3a

Please sign in to comment.