docstr: target: test apply memory stress during loading, and querynode OOMKilled
  method: 1.Deploy and limit querynode memory limit 6Gi
          2.Create collection and insert 1000,000 entities
          3.Apply memory stress and querynode OOMKilled during loading replicas
  expected: Verify the mic is available to load and search querynode restart
docstr_tok: ["target",":","test","apply","memory","stress","during","loading",",","and","querynode","OOMKilled","method",":","1.Deploy","and","limit","querynode","memory","limit","6Gi","2.Create","collection","and","insert","1000,000","entities","3.Apply","memory","stress","and","querynode","OOMKilled","during","loading","replicas","expected",":","Verify","the","mic","is","available","to","load","and","search","querynode","restart"]
code: def test_chaos_memory_stress_replicas_OOM(
      self, prepare_collection, mode
  ):
      """
      target: test apply memory stress during loading, and querynode OOMKilled
      method: 1.Deploy and limit querynode memory limit 6Gi
              2.Create collection and insert 1000,000 entities
              3.Apply memory stress and querynode OOMKilled during loading replicas
      expected: Verify the mic is available to load and search querynode restart
      """
      collection_w = prepare_collection
      utility_w = ApiUtilityWrapper()
  
      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"] = "6Gi"
      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")
      collection_w.load(replica_number=2, timeout=60, _async=True)
  
      utility_w.wait_for_loading_complete(collection_w.name)
      progress, _ = utility_w.loading_progress(collection_w.name)
      assert progress["loading_progress"] == "100%"
  
      sleep(180)
      chaos_res.delete(
          metadata_name=chaos_config.get("metadata", None).get(
              "name", None
          )
      )
  
      # TODO search failed
      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()
      collection_w.load(replica_number=2)
      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]
      )
  
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 5 for calling the TestMemoryStressReplica obj's underlying member method code with example usage: obj.test_chaos_memory_stress_replicas_OOM(prepare_collection, mode) without return types