code: def test_out_of_band_task_is_not_cancelled(serve_instance):
      """
      Test cancelling a request doesn't cancel tasks submitted
      outside the request's context.
      """
      signal_actor = SignalActor.remote()
  
      @serve.deployment
      class Downstream:
          async def hi(self):
              await signal_actor.wait.remote()
              return "ok"
  
      @serve.deployment
      class Ingress:
          def __init__(self, handle):
              self._h = handle.options(use_new_handle_api=True)
              self._out_of_band_req = self._h.hi.remote()
  
          async def __call__(self, *args):
              await self._h.hi.remote()
  
          async def get_out_of_band_response(self):
              return await self._out_of_band_req
  
      h = serve.run(Ingress.bind(Downstream.bind())).options(
          use_new_handle_api=True
      )
  
      # Send a request, wait for downstream request to start, and cancel it.
      r1 = h.remote()
      wait_for_condition(
          lambda: ray.get(signal_actor.cur_num_waiters.remote()) == 2
      )
  
      r1.cancel()
      with pytest.raises(ray.exceptions.TaskCancelledError):
          r1.result()
  
      # Now signal out of band request to run to completion and check that it wasn't
      # cancelled.
      ray.get(signal_actor.send.remote())
      assert h.get_out_of_band_response.remote().result() == "ok"
  
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 10 for calling a global function with example usage: test_out_of_band_task_is_not_cancelled(serve_instance) and returns: str, unknown