code: def test_get_node_info_after_raylet_died(ray_start_cluster_head):
      cluster = ray_start_cluster_head
  
      def get_node_info():
          return ray._private.services.get_node_to_connect_for_driver(
              cluster.gcs_address,
              cluster.head_node.node_ip_address,
          )
  
      assert (
          get_node_info()["raylet_socket_name"]
          == cluster.head_node.raylet_socket_name
      )
  
      cluster.head_node.kill_raylet()
      wait_for_condition(
          lambda: not cluster.global_state.node_table()[0]["Alive"],
          timeout=30,
      )
      with pytest.raises(RuntimeError):
          get_node_info()
  
      node2 = cluster.add_node()
      assert (
          get_node_info()["raylet_socket_name"]
          == node2.raylet_socket_name
      )
  
file_path: ray/python/ray/tests/test_component_failures_2.py
imports: import signal
  import sys
  import time
  import pytest
  import ray
  import ray._private.ray_constants
  from ray._private.test_utils import get_other_nodes, wait_for_condition
  from ray.cluster_utils import Cluster, cluster_not_supported
label_desc: Use image node_id 5 for calling a global function with example usage: test_get_node_info_after_raylet_died(ray_start_cluster_head) and returns: ray