[Dashboard][Bug] Fix duplicate node total rows in dashboard (#12410)

* 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
This commit is contained in:
Max Fitton
2020-11-30 18:43:09 -08:00
committed by GitHub
parent e422ace053
commit 2708b3abbc
2 changed files with 15 additions and 23 deletions
@@ -88,7 +88,7 @@ const makeGroupedTableContents = (
);
return (
<NodeRowGroup
key={node.ip}
key={node.raylet.nodeId}
node={node}
workerFeatureData={sortedClusterWorkers}
features={nodeInfoFeatures}
+14 -22
View File
@@ -16,12 +16,9 @@ import redis
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
@@ -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.