code: def test_worker_raising_exception(ray_start_regular, error_pubsub):
      p = error_pubsub
  
      @ray.remote(max_calls=2)
      def f():
          # This is the only reasonable variable we can set here that makes the
          # execute_task function fail after the task got executed.
          worker = ray._private.worker.global_worker
          worker.function_actor_manager.increase_task_counter = None
  
      # Running this task should cause the worker to raise an exception after
      # the task has successfully completed.
      f.remote()
      errors = get_error_message(
          p, 1, ray_constants.WORKER_CRASH_PUSH_ERROR
      )
      assert len(errors) == 1
      assert errors[0]["type"] == ray_constants.WORKER_CRASH_PUSH_ERROR
  
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 7 for calling a global function with example usage: test_worker_raising_exception(ray_start_regular, error_pubsub) without return types