code: def test_agent_report_unexpected_raylet_death(shutdown_only):
      """Test agent reports Raylet death if it is not SIGTERM."""
  
      ray.init()
      p = init_error_pubsub()
  
      node = ray._private.worker._global_node
      all_processes = node.all_processes
      raylet_proc_info = all_processes[
          ray_constants.PROCESS_TYPE_RAYLET
      ][0]
      raylet_proc = psutil.Process(raylet_proc_info.process.pid)
  
      wait_for_condition(lambda: search_agent(raylet_proc.children()))
      agent_proc = search_agent(raylet_proc.children())
      agent_pid = agent_proc.pid
  
      check_agent_register(raylet_proc, agent_pid)
  
      # The agent should be dead if raylet exits.
      raylet_proc.kill()
      raylet_proc.wait()
      agent_proc.wait(15)
  
      errors = get_error_message(p, 1, ray_constants.RAYLET_DIED_ERROR)
      assert len(errors) == 1, errors
      err = errors[0]
      assert err["type"] == ray_constants.RAYLET_DIED_ERROR
      assert "Termination is unexpected." in err["error_message"], err[
          "error_message"
      ]
      assert "Raylet logs:" in err["error_message"], err[
          "error_message"
      ]
      assert (
          os.path.getsize(
              os.path.join(
                  node.get_session_dir_path(), "logs", "raylet.out"
              )
          )
          < 1 * 1024**2
      )
  
file_path: ray/python/ray/tests/test_runtime_env_agent.py
imports: import sys
  import pytest
  import logging
  import os
  import time
  from typing import List, Tuple
  import ray
  from ray._private.runtime_env.agent.runtime_env_agent import UriType, ReferenceTable
  from ray._private import ray_constants
  from ray._private.test_utils import get_error_message, init_error_pubsub, wait_for_condition
  from ray.runtime_env import RuntimeEnv
  import psutil
label_desc: Use image node_id 5 for calling a global function with example usage: test_agent_report_unexpected_raylet_death(shutdown_only) without return types