code: def test_list_named_actors_restarting_actor(ray_start_regular):
      @ray.remote(max_restarts=-1)
      class A:
          def __init__(self):
              os._exit(0)
  
      a = A.options(name="hi").remote()
      for _ in range(10000):
          assert ray.util.list_named_actors() == ["hi"]
  
      del a
      wait_for_condition(lambda: not ray.util.list_named_actors())
  
imports: import os
  import pytest
  import sys
  import ray
  from ray._private.test_utils import wait_for_condition
label_desc: Use image node_id 1 for calling a global function with example usage: test_list_named_actors_restarting_actor(ray_start_regular) without return types