code: def test_nodes_update(enable_test_module, ray_start_with_dashboard):
      assert (
          wait_until_server_available(
              ray_start_with_dashboard["webui_url"]
          )
          is True
      )
      webui_url = ray_start_with_dashboard["webui_url"]
      webui_url = format_web_url(webui_url)
  
      timeout_seconds = 10
      start_time = time.time()
      while True:
          time.sleep(1)
          try:
              response = requests.get(webui_url + "/test/dump")
              response.raise_for_status()
              try:
                  dump_info = response.json()
              except Exception as ex:
                  logger.info("failed response: %s", response.text)
                  raise ex
              assert dump_info["result"] is True
              dump_data = dump_info["data"]
              assert len(dump_data["nodes"]) == 1
              assert len(dump_data["agents"]) == 1
              assert len(dump_data["nodeIdToIp"]) == 1
              assert len(dump_data["nodeIdToHostname"]) == 1
              assert (
                  dump_data["nodes"].keys()
                  == dump_data["nodeIdToHostname"].keys()
              )
  
              response = requests.get(
                  webui_url + "/test/notified_agents"
              )
              response.raise_for_status()
              try:
                  notified_agents = response.json()
              except Exception as ex:
                  logger.info("failed response: %s", response.text)
                  raise ex
              assert notified_agents["result"] is True
              notified_agents = notified_agents["data"]
              assert len(notified_agents) == 1
              assert notified_agents == dump_data["agents"]
              break
          except (
              AssertionError,
              requests.exceptions.ConnectionError,
          ) as e:
              logger.info("Retry because of %s", e)
          finally:
              if time.time() > start_time + timeout_seconds:
                  raise Exception("Timed out while testing.")
  
file_path: ray/dashboard/modules/node/tests/test_node.py
imports: import os
  import sys
  import logging
  import requests
  import time
  import traceback
  import random
  import pytest
  import ray
  import threading
  from datetime import datetime, timedelta
  from ray.cluster_utils import Cluster
  from ray.dashboard.modules.node.node_consts import UPDATE_NODES_INTERVAL_SECONDS
  from ray.dashboard.tests.conftest import *
  from ray._private.test_utils import format_web_url, wait_until_server_available, wait_for_condition
label_desc: Use image node_id 1 for calling a global function with example usage: test_nodes_update(enable_test_module, ray_start_with_dashboard) without return types