code: def test_gcs_server_restart_during_actor_creation(
      ray_start_regular_with_external_redis,
  ):
      ids = []
      # We reduce the number of actors because there are too many actors created
      # and `Too many open files` error will be thrown.
      for i in range(0, 20):
          actor = Increase.remote()
          ids.append(actor.method.remote(1))
  
      ray._private.worker._global_node.kill_gcs_server()
      ray._private.worker._global_node.start_gcs_server()
  
      # The timeout seems too long.
      # TODO(mwtian): after fixing reconnection in GCS pubsub, try using a lower
      # timeout.
      ready, unready = ray.wait(ids, num_returns=20, timeout=240)
      print("Ready objects is {}.".format(ready))
      print("Unready objects is {}.".format(unready))
      assert len(unready) == 0
  
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 3 for calling a global function with example usage: test_gcs_server_restart_during_actor_creation(ray_start_regular_with_external_redis) without return types