code: def test_reconfigure_with_queries(serve_instance):
      signal = SignalActor.remote()
  
      @serve.deployment(max_concurrent_queries=10, num_replicas=3)
      class A:
          def __init__(self):
              self.state = None
  
          def reconfigure(self, config):
              self.state = config
  
          async def __call__(self):
              await signal.wait.remote()
              return self.state["a"]
  
      handle = serve.run(
          A.options(version="1", user_config={"a": 1}).bind()
      )
      responses = [handle.remote() for _ in range(30)]
  
      @ray.remote(num_cpus=0)
      def reconfigure():
          serve.run(A.options(version="1", user_config={"a": 2}).bind())
  
      reconfigure_ref = reconfigure.remote()
      signal.send.remote()
      ray.get(reconfigure_ref)
  
      assert all([r.result() == 1 for r in responses])
      assert handle.remote().result() == 2
  
imports: import os
  import sys
  import time
  from collections import defaultdict
  from typing import Callable
  import pytest
  import requests
  import ray
  from ray import serve
  from ray._private.pydantic_compat import ValidationError
  from ray._private.test_utils import SignalActor
  from ray.serve._private.utils import get_random_string
  from ray.serve.exceptions import RayServeException
label_desc: Use image node_id 7 for calling a global function with example usage: test_reconfigure_with_queries(serve_instance) and returns: self