code: def test_worker_id_names(shutdown_only):
      ray.init(
          num_cpus=1,
          _system_config={
              "event_stats_print_interval_ms": 100,
              "event_stats": True,
          },
      )
      session_dir = ray._private.worker.global_worker.node.address_info[
          "session_dir"
      ]
      session_path = Path(session_dir)
      log_dir_path = session_path / "logs"
  
      # Run the basic workload.
      @ray.remote
      def f():
          print("hello")
  
      ray.get(f.remote())
  
      paths = list(log_dir_path.iterdir())
  
      ids = []
      for path in paths:
          if "python-core-worker" in str(path):
              pattern = ".*-([a-f0-9]*).*"
          elif "worker" in str(path):
              pattern = ".*worker-([a-f0-9]*)-.*-.*"
          else:
              continue
          worker_id = re.match(pattern, str(path)).group(1)
          ids.append(worker_id)
      counts = Counter(ids).values()
      for count in counts:
          # There should be a "python-core-.*.log", "worker-.*.out",
          # and "worker-.*.err"
          assert count == 3
  
imports: import io
  import os
  import re
  import subprocess
  import sys
  import tempfile
  import time
  import logging
  from collections import Counter, defaultdict
  from contextlib import redirect_stderr, redirect_stdout
  from pathlib import Path
  from unittest.mock import Mock, MagicMock
  import pytest
  import ray
  from ray._private import ray_constants
  from ray._private.log_monitor import LOG_NAME_UPDATE_INTERVAL_S, RAY_LOG_MONITOR_MANY_FILES_THRESHOLD, LogFileInfo, LogMonitor, is_proc_alive
  from ray._private.test_utils import get_log_batch, get_log_message, get_log_data, init_log_pubsub, run_string_as_driver, wait_for_condition
  from ray.cross_language import java_actor_class
  from ray.autoscaler._private.cli_logger import cli_logger
label_desc: Use image node_id 8 for calling a global function with example usage: test_worker_id_names(shutdown_only) without return types