code: def test_cancel_on_http_timeout_during_execution(
      ray_instance, shutdown_serve, use_fastapi: bool
  ):
      """Test the request timing out while the handler is executing."""
      inner_signal_actor = SignalActor.remote()
      outer_signal_actor = SignalActor.remote()
  
      @serve.deployment
      async def inner():
          await send_signal_on_cancellation(inner_signal_actor)
  
      if use_fastapi:
          app = FastAPI()
  
          @serve.deployment
          @serve.ingress(app)
          class Ingress:
              def __init__(self, handle):
                  self._handle = handle.options(use_new_handle_api=True)
  
              @app.get("/")
              async def wait_for_cancellation(self):
                  await self._handle.remote()._to_object_ref()
                  await send_signal_on_cancellation(outer_signal_actor)
  
      else:
  
          @serve.deployment
          class Ingress:
              def __init__(self, handle):
                  self._handle = handle.options(use_new_handle_api=True)
  
              async def __call__(self, request: Request):
                  await self._handle.remote()._to_object_ref()
                  await send_signal_on_cancellation(outer_signal_actor)
  
      serve.run(Ingress.bind(inner.bind()))
  
      # Request should time out, causing the handler and handle call to be cancelled.
      assert requests.get("http://localhost:8000").status_code == 408
      ray.get(inner_signal_actor.wait.remote())
      ray.get(outer_signal_actor.wait.remote())
  
imports: import asyncio
  import os
  import sys
  import time
  from typing import Generator, Set
  import pytest
  import requests
  from fastapi import FastAPI
  from starlette.requests import Request
  from starlette.responses import StreamingResponse
  import ray
  from ray import serve
  from ray._private.test_utils import SignalActor, wait_for_condition
  from ray.dashboard.modules.serve.sdk import ServeSubmissionClient
  from ray.serve._private.common import ApplicationStatus
  from ray.serve._private.test_utils import send_signal_on_cancellation
  from ray.serve.schema import ServeInstanceDetails
  from ray.util.state import list_tasks
label_desc: Use image node_id 9 for calling a global function with example usage: test_cancel_on_http_timeout_during_execution(ray_instance, shutdown_serve, use_fastapi) without return types