docstr: target: test apply memory stress on single node replica, and it OOMKilled
  method: 1.Deploy 2 querynodes and limit memory 6Gi
          2.Loading 1000,000 entities (data_size=500Mb) with 2 replicas (memory_usage=1.5Gb)
          3.Apply memory stress on one querynode and make it OOMKilled
  expected: After deleting chaos, querynode turns running, search successfully
docstr_tok: ["target",":","test","apply","memory","stress","on","single","node","replica",",","and","it","OOMKilled","method",":","1.Deploy","2","querynodes","and","limit","memory","6Gi","2.Loading","1000,000","entities","(","data_size=500Mb",")","with","2","replicas","(","memory_usage=1.5Gb",")","3.Apply","memory","stress","on","one","querynode","and","make","it","OOMKilled","expected",":","After","deleting","chaos",",","querynode","turns","running",",","search","successfully"]
code: def test_memory_stress_replicas_load_balance_single_node(
      self, prepare_collection
  ):
      """
      target: test apply memory stress on single node replica, and it OOMKilled
      method: 1.Deploy 2 querynodes and limit memory 6Gi
              2.Loading 1000,000 entities (data_size=500Mb) with 2 replicas (memory_usage=1.5Gb)
              3.Apply memory stress on one querynode and make it OOMKilled
      expected: After deleting chaos, querynode turns running, search successfully
      """
      collection_w = prepare_collection
      utility_w = ApiUtilityWrapper()
  
      # load and searchc
      collection_w.load(replica_number=2)
      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
  
      # apply memory stress
      chaos_config = gen_experiment_config(
          "./chaos_objects/memory_stress/chaos_querynode_memory_stress.yaml"
      )
  
      # Update config
      chaos_config["spec"]["mode"] = "one"
      chaos_config["spec"]["stressors"]["memory"]["size"] = "6Gi"
      chaos_config["spec"]["duration"] = "1m"
      log.debug(chaos_config)
      duration = chaos_config.get("spec").get("duration")
      duration = (
          duration.replace("h", "*3600+")
          .replace("m", "*60+")
          .replace("s", "*1+")
          + "+0"
      )
      chaos_res = CusResource(
          kind=chaos_config["kind"],
          group=constants.CHAOS_GROUP,
          version=constants.CHAOS_VERSION,
          namespace=constants.CHAOS_NAMESPACE,
      )
      chaos_res.create(chaos_config)
  
      sleep(eval(duration))
      chaos_res.delete(
          metadata_name=chaos_config.get("metadata", None).get(
              "name", None
          )
      )
  
      # release and load again
      collection_w.release()
      collection_w.load(replica_number=2)
      progress, _ = utility_w.loading_progress(collection_w.name)
      assert progress["loading_progress"] == "100%"
      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 4 for calling the TestMemoryStressReplicaLoadBalance obj's underlying member method code with example usage: obj.test_memory_stress_replicas_load_balance_single_node(prepare_collection) without return types