docstr: Unit test simulating replicas taking time to start up.
docstr_tok: ["Unit","test","simulating","replicas","taking","time","to","start","up","."]
code: def test_replicas_delayed_startup(self):
      """Unit test simulating replicas taking time to start up."""
      config = AutoscalingConfig(
          min_replicas=1,
          max_replicas=200,
          target_num_ongoing_requests_per_replica=1,
          upscale_delay_s=0,
          downscale_delay_s=100000,
      )
  
      policy_manager = AutoscalingPolicyManager(config)
  
      new_num_replicas = policy_manager.get_decision_num_replicas(
          1, [100], 0
      )
      assert new_num_replicas == 100
  
      # New target is 100, but no new replicas finished spinning up during this
      # timestep.
      new_num_replicas = policy_manager.get_decision_num_replicas(
          100, [100], 0
      )
      assert new_num_replicas == 100
  
      # Two new replicas spun up during this timestep.
      new_num_replicas = policy_manager.get_decision_num_replicas(
          100, [100, 20, 3], 0
      )
      assert new_num_replicas == 123
  
      # A lot of queries got drained and a lot of replicas started up, but
      # new_num_replicas should not decrease, because of the downscale delay.
      new_num_replicas = policy_manager.get_decision_num_replicas(
          123, [6, 2, 1, 1], 0
      )
      assert new_num_replicas == 123
  
imports: import sys
  import numpy
  import pytest
  from ray.serve._private.autoscaling_policy import AutoscalingPolicyManager
  from ray.serve._private.constants import CONTROL_LOOP_PERIOD_S
  from ray.serve.autoscaling_policy import _calculate_desired_num_replicas
  from ray.serve.config import AutoscalingConfig
label_desc: Use image node_id 4 for calling the TestGetDecisionNumReplicas obj's underlying member method code with example usage: obj.test_replicas_delayed_startup() without return types