docstr: target: test apply stress memory on one querynode and the memory is enough to load replicas
  method: 1.Limit all querynodes memory 6Gi
          2.Apply 3Gi memory stress on different number of querynodes (load whole collection need about 1.5GB)
  expected: Verify load successfully and search result are correct
docstr_tok: ["target",":","test","apply","stress","memory","on","one","querynode","and","the","memory","is","enough","to","load","replicas","method",":","1.Limit","all","querynodes","memory","6Gi","2.Apply","3Gi","memory","stress","on","different","number","of","querynodes","(","load","whole","collection","need","about","1.5GB",")","expected",":","Verify","load","successfully","and","search","result","are","correct"]
code: def test_memory_stress_replicas_group_sufficient(
      self, prepare_collection, mode
  ):
      """
      target: test apply stress memory on one querynode and the memory is enough to load replicas
      method: 1.Limit all querynodes memory 6Gi
              2.Apply 3Gi memory stress on different number of querynodes (load whole collection need about 1.5GB)
      expected: Verify load successfully and search result are correct
      """
      collection_w = prepare_collection
      utility_w = ApiUtilityWrapper()
  
      # # apply memory stress chaos
      chaos_config = gen_experiment_config(
          "./chaos_objects/memory_stress/chaos_querynode_memory_stress.yaml"
      )
      chaos_config["spec"]["mode"] = mode
      chaos_config["spec"]["duration"] = "3m"
      chaos_config["spec"]["stressors"]["memory"]["size"] = "3Gi"
      log.debug(chaos_config)
      chaos_res = CusResource(
          kind=chaos_config["kind"],
          group=constants.CHAOS_GROUP,
          version=constants.CHAOS_VERSION,
          namespace=constants.CHAOS_NAMESPACE,
      )
      chaos_res.create(chaos_config)
      log.debug("chaos injected")
      sleep(20)
      #
      try:
          collection_w.load(replica_number=2, timeout=60)
          utility_w.loading_progress(collection_w.name)
          replicas, _ = collection_w.get_replicas()
          log.debug(replicas)
          search_res, _ = collection_w.search(
              cf.gen_vectors(1, dim=self.dim),
              ct.default_float_vec_field_name,
              ct.default_search_params,
              ct.default_limit,
              timeout=120,
          )
          assert 1 == len(search_res) and ct.default_limit == len(
              search_res[0]
          )
          collection_w.release()
  
      except Exception as e:
          raise Exception(str(e))
  
      finally:
          # delete chaos
          meta_name = chaos_config.get("metadata", None).get(
              "name", None
          )
          chaos_res.delete(metadata_name=meta_name)
          log.debug("Test finished")
  
imports: import random
  import threading
  import time
  from time import sleep
  import pytest
  import datetime
  from pymilvus import connections
  from base.collection_wrapper import ApiCollectionWrapper
  from base.utility_wrapper import ApiUtilityWrapper
  from chaos.checker import Op, CollectionCreateChecker, InsertFlushChecker, IndexCreateChecker, SearchChecker, QueryChecker
  from common.cus_resource_opts import CustomResourceOperations
  from common import common_func
  from common import common_type
  from chaos import chaos_commons
  from chaos.chaos_commons import gen_experiment_config, get_chaos_yamls, start_monitor_threads
  from common.common_type import CaseLabel, CheckTasks
  from chaos import constants
  from utils.util_log import test_log
  from utils.util_k8s import get_querynode_id_pod_pairs
label_desc: Use image node_id 3 for calling the TestMemoryStressReplica obj's underlying member method code with example usage: obj.test_memory_stress_replicas_group_sufficient(prepare_collection, mode) without return types