code: def test_e2e_raise_min_replicas(serve_instance):
      controller = serve_instance._controller
      signal = SignalActor.options(name="signal123").remote()
  
      app_config = {
          "import_path": "ray.serve.tests.test_config_files.get_signal.app",
          "deployments": [
              {
                  "name": "A",
                  "autoscaling_config": {
                      "metrics_interval_s": 0.1,
                      "min_replicas": 0,
                      "max_replicas": 10,
                      "look_back_period_s": 0.2,
                      "downscale_delay_s": 0.2,
                      "upscale_delay_s": 0.2,
                  },
                  "graceful_shutdown_timeout_s": 1,
                  "max_concurrent_queries": 1000,
              }
          ],
      }
  
      serve_instance.deploy_apps(
          ServeDeploySchema(**{"applications": [app_config]})
      )
      print("Deployed A.")
      wait_for_condition(
          lambda: get_deployment_status(controller, "A")
          == DeploymentStatus.HEALTHY
      )
      start_time = get_deployment_start_time(controller, "A")
  
      check_autoscale_num_replicas_eq(controller, "A", 0)
  
      handle = serve.get_deployment_handle("A", "default")
      handle.remote()
      print("Issued one request.")
  
      time.sleep(2)
      check_autoscale_num_replicas_eq(controller, "A", 1)
      print("Scale up to 1 replica.")
  
      first_deployment_replicas = get_running_replica_tags(
          controller, "A"
      )
  
      app_config["deployments"][0]["autoscaling_config"][
          "min_replicas"
      ] = 2
      serve_instance.deploy_apps(
          ServeDeploySchema(**{"applications": [app_config]})
      )
      print("Redeployed A with min_replicas set to 2.")
      wait_for_condition(
          lambda: get_deployment_status(controller, "A")
          == DeploymentStatus.HEALTHY
      )
  
      # Confirm that autoscaler doesn't scale above 2 even after waiting
      time.sleep(5)
      check_autoscale_num_replicas_eq(controller, "A", 2)
      print("Autoscaled to 2 without issuing any new requests.")
  
      second_deployment_replicas = get_running_replica_tags(
          controller, "A"
      )
  
      # Confirm that none of the original replicas were de-provisioned
      assert_no_replicas_deprovisioned(
          first_deployment_replicas, second_deployment_replicas
      )
  
      signal.send.remote()
      time.sleep(1)
      print("Completed request.")
  
      # As the queue is drained, we should scale back down.
      wait_for_condition(
          check_autoscale_num_replicas_lte,
          controller=controller,
          name="A",
          target=2,
      )
      check_autoscale_num_replicas_gte(controller, "A", 2)
      print("Stayed at 2 replicas.")
  
      # Make sure start time did not change for the deployment
      assert get_deployment_start_time(controller, "A") == start_time
  
imports: import asyncio
  import logging
  import os
  import sys
  import tempfile
  import time
  import zipfile
  from typing import Dict, Iterable, List
  from unittest import mock
  import pytest
  import requests
  import ray
  import ray.util.state
  from ray import serve
  from ray._private.test_utils import SignalActor, wait_for_condition
  from ray.serve._private.common import ApplicationStatus, DeploymentID, DeploymentStatus, DeploymentStatusInfo, DeploymentStatusTrigger, ReplicaState
  from ray.serve._private.constants import SERVE_DEFAULT_APP_NAME, SERVE_NAMESPACE
  from ray.serve._private.controller import ServeController
  from ray.serve.config import AutoscalingConfig
  from ray.serve.generated.serve_pb2 import DeploymentStatusInfo
  from ray.serve.schema import ServeDeploySchema
label_desc: Use image node_id 18 for calling a global function with example usage: test_e2e_raise_min_replicas(serve_instance) without return types