code: def test_cancel_sync_handle_call_during_execution(serve_instance):
      """Test cancelling handle request during execution (sync context)."""
      running_signal_actor = SignalActor.remote()
      cancelled_signal_actor = SignalActor.remote()
  
      @serve.deployment
      class Ingress:
          async def __call__(self, *args):
              await running_signal_actor.send.remote()
              await send_signal_on_cancellation(cancelled_signal_actor)
  
      h = serve.run(Ingress.bind()).options(use_new_handle_api=True)
  
      # Send a request and wait for it to start executing.
      r = h.remote()
      ray.get(running_signal_actor.wait.remote(), timeout=10)
  
      # Cancel it and verify that it is cancelled via signal.
      r.cancel()
      ray.get(cancelled_signal_actor.wait.remote(), timeout=10)
  
      with pytest.raises(ray.exceptions.TaskCancelledError):
          r.result()
  
imports: import asyncio
  import concurrent.futures
  import sys
  import pytest
  import requests
  from fastapi import FastAPI
  from starlette.requests import Request
  import ray
  from ray import serve
  from ray._private.test_utils import SignalActor, async_wait_for_condition, wait_for_condition
  from ray.serve._private.test_utils import send_signal_on_cancellation
label_desc: Use image node_id 3 for calling a global function with example usage: test_cancel_sync_handle_call_during_execution(serve_instance) without return types