code: def test_actor_raylet_resubscription(
      ray_start_regular_with_external_redis,
  ):
      # stat an actor
      @ray.remote
      class A:
          def ready(self):
              import os
  
              return os.getpid()
  
      actor = A.options(name="abc", max_restarts=0).remote()
      pid = ray.get(actor.ready.remote())
      print("actor is ready and kill gcs")
  
      ray._private.worker._global_node.kill_gcs_server()
  
      print("make actor exit")
      import psutil
  
      p = psutil.Process(pid)
      p.kill()
      from time import sleep
  
      sleep(1)
      print("start gcs")
      ray._private.worker._global_node.start_gcs_server()
  
      print("try actor method again")
      with pytest.raises(ray.exceptions.RayActorError):
          ray.get(actor.ready.remote())
  
imports: import sys
  import os
  import threading
  from time import sleep
  import pytest
  import ray
  from ray._private.utils import get_or_create_event_loop
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
  import ray._private.gcs_utils
  from ray._private import ray_constants
  from ray._private.test_utils import convert_actor_state, enable_external_redis, generate_system_config_map, wait_for_condition, wait_for_pid_to_exit, run_string_as_driver
  from ray.job_submission import JobSubmissionClient, JobStatus
  from ray._raylet import GcsClient
  import psutil
label_desc: Use image node_id 6 for calling a global function with example usage: test_actor_raylet_resubscription(ray_start_regular_with_external_redis) and returns: os