code: def test_dashboard(shutdown_only):
      addresses = ray.init(include_dashboard=True, num_cpus=1)
      dashboard_url = addresses["webui_url"]
      assert ray._private.worker.get_dashboard_url() == dashboard_url
  
      assert re.match(
          r"^(localhost|\d+\.\d+\.\d+\.\d+):\d+$", dashboard_url
      )
  
      start_time = time.time()
      while True:
          try:
              node_info_url = f"http://{dashboard_url}/nodes"
              resp = requests.get(
                  node_info_url, params={"view": "summary"}
              )
              resp.raise_for_status()
              summaries = resp.json()
              assert summaries["result"] is True
              assert "msg" in summaries
              break
          except (requests.exceptions.ConnectionError, AssertionError):
              if time.time() > start_time + 30:
                  out_log = None
                  with open(
                      "{}/logs/dashboard.log".format(
                          addresses["session_dir"]
                      ),
                      "r",
                  ) as f:
                      out_log = f.read()
                  raise Exception(
                      "Timed out while waiting for dashboard to start. "
                      f"Dashboard output log: {out_log}\n"
                  )
  
imports: import os
  import re
  import subprocess
  import sys
  import time
  import psutil
  import pytest
  import requests
  import ray
  from ray._private import ray_constants
  from ray._private.test_utils import run_string_as_driver, wait_for_condition
label_desc: Use image node_id 5 for calling a global function with example usage: test_dashboard(shutdown_only) without return types