docstr: target: test apply stress memory on different number querynodes and the group failed to load,
          because of the memory is insufficient
  method: 1.Limit querynodes memory 5Gi
          2.Create collection and insert 1000,000 entities
          3.Apply memory stress on querynodes and it's memory is not enough to load replicas
  expected: Verify load raise exception, and after delete chaos, load and search successfully
docstr_tok: ["target",":","test","apply","stress","memory","on","different","number","querynodes","and","the","group","failed","to","load",",","because","of","the","memory","is","insufficient","method",":","1.Limit","querynodes","memory","5Gi","2.Create","collection","and","insert","1000,000","entities","3.Apply","memory","stress","on","querynodes","and","it","'s","memory","is","not","enough","to","load","replicas","expected",":","Verify","load","raise","exception",",","and","after","delete","chaos",",","load","and","search","successfully"]
code: def test_memory_stress_replicas_group_insufficient(
      self, prepare_collection, mode
  ):
      """
      target: test apply stress memory on different number querynodes and the group failed to load,
              because of the memory is insufficient
      method: 1.Limit querynodes memory 5Gi
              2.Create collection and insert 1000,000 entities
              3.Apply memory stress on querynodes and it's memory is not enough to load replicas
      expected: Verify load raise exception, and after delete chaos, load and search successfully
      """
      collection_w = prepare_collection
      utility_w = ApiUtilityWrapper()
      chaos_config = gen_experiment_config(
          "./chaos_objects/memory_stress/chaos_querynode_memory_stress.yaml"
      )
  
      # Update config
      chaos_config["spec"]["mode"] = mode
      chaos_config["spec"]["stressors"]["memory"]["size"] = "5Gi"
      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)
      # chaos_start = time.time()
      log.debug("chaos injected")
      sleep(10)
  
      try:
          # load failed
          err = {
              "err_code": 1,
              "err_msg": "shuffleSegmentsToQueryNodeV2: insufficient memory of available node",
          }
          collection_w.load(
              replica_number=5,
              timeout=60,
              check_task=CheckTasks.err_res,
              check_items=err,
          )
  
          # query failed because not loaded
          err = {"err_code": 1, "err_msg": "not loaded into memory"}
          collection_w.query(
              "int64 in [0]",
              check_task=CheckTasks.err_res,
              check_items=err,
          )
  
          # delete chaos
          meta_name = chaos_config.get("metadata", None).get(
              "name", None
          )
          chaos_res.delete(metadata_name=meta_name)
          sleep(10)
  
          # after delete chaos load and query successfully
          collection_w.load(replica_number=5, timeout=60)
          progress, _ = utility_w.loading_progress(collection_w.name)
          # assert progress["loading_progress"] == "100%"
          query_res, _ = collection_w.query("int64 in [0]")
          assert len(query_res) != 0
  
          collection_w.release()
  
      except Exception as e:
          raise Exception(str(e))
  
      finally:
          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 4 for calling the TestMemoryStressReplica obj's underlying member method code with example usage: obj.test_memory_stress_replicas_group_insufficient(prepare_collection, mode) without return types