code: def test_worker_dying(ray_start_regular, error_pubsub):
      p = error_pubsub
      # Define a remote function that will kill the worker that runs it.
  
      @ray.remote(max_retries=0)
      def f():
          eval("exit()")
  
      with pytest.raises(ray.exceptions.WorkerCrashedError):
          ray.get(f.remote())
  
      errors = get_error_message(
          p, 1, ray_constants.WORKER_DIED_PUSH_ERROR
      )
      assert len(errors) == 1
      assert errors[0]["type"] == ray_constants.WORKER_DIED_PUSH_ERROR
      assert (
          "died or was killed while executing"
          in errors[0]["error_message"]
      )
  
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 8 for calling a global function with example usage: test_worker_dying(ray_start_regular, error_pubsub) without return types