code: def test_failed_actor_init(ray_start_regular, error_pubsub):
      p = error_pubsub
      error_message1 = "actor constructor failed"
      error_message2 = "actor method failed"
  
      @ray.remote
      class FailedActor:
          def __init__(self):
              raise Exception(error_message1)
  
          def fail_method(self):
              raise Exception(error_message2)
  
      a = FailedActor.remote()
  
      # Make sure that we get errors from a failed constructor.
      errors = get_error_message(p, 1, ray_constants.TASK_PUSH_ERROR)
      assert len(errors) == 1
      assert errors[0]["type"] == ray_constants.TASK_PUSH_ERROR
      assert error_message1 in errors[0]["error_message"]
  
      # Incoming methods will get the exception in creation task
      with pytest.raises(ray.exceptions.RayActorError) as e:
          ray.get(a.fail_method.remote())
      assert error_message1 in str(e.value)
  
imports: import os
  import signal
  import sys
  import time
  import numpy
  import pytest
  import ray
  import ray._private.gcs_utils
  import ray._private.ray_constants
  import ray._private.utils
  from ray._private.test_utils import SignalActor, convert_actor_state, get_error_message, init_error_pubsub, wait_for_condition
  from ray.exceptions import GetTimeoutError, RayActorError, RayTaskError
label_desc: Use image node_id 4 for calling a global function with example usage: test_failed_actor_init(ray_start_regular, error_pubsub) without return types