docstr: target: test apply memory stress on one group and no load balance cross replica groups
  method: 1.Limit all querynodes memory 6Gi
          2.Create and insert 1000,000 entities
          3.Load collection with two replicas
          4.Apply memory stress on one group 80%
  expected: Verify that load balancing across groups is not occurring
docstr_tok: ["target",":","test","apply","memory","stress","on","one","group","and","no","load","balance","cross","replica","groups","method",":","1.Limit","all","querynodes","memory","6Gi","2.Create","and","insert","1000,000","entities","3.Load","collection","with","two","replicas","4.Apply","memory","stress","on","one","group","80","%","expected",":","Verify","that","load","balancing","across","groups","is","not","occurring"]
code: def test_memory_stress_replicas_cross_group_load_balance(
      self, prepare_collection
  ):
      """
      target: test apply memory stress on one group and no load balance cross replica groups
      method: 1.Limit all querynodes memory 6Gi
              2.Create and insert 1000,000 entities
              3.Load collection with two replicas
              4.Apply memory stress on one group 80%
      expected: Verify that load balancing across groups is not occurring
      """
      collection_w = prepare_collection
      utility_w = ApiUtilityWrapper()
      release_name = "mic-memory"
  
      # load and searchc
      collection_w.load(replica_number=2)
      progress, _ = utility_w.loading_progress(collection_w.name)
      assert progress["loading_progress"] == "100%"
      seg_info_before, _ = utility_w.get_query_segment_info(
          collection_w.name
      )
  
      # get the replica and random chaos querynode
      replicas, _ = collection_w.get_replicas()
      group_nodes = list(replicas.groups[0].group_nodes)
      label = f"app.kubernetes.io/instance={release_name}, app.kubernetes.io/component=querynode"
      querynode_id_pod_pair = get_querynode_id_pod_pairs(
          "chaos-testing", label
      )
      group_nodes_pod = [
          querynode_id_pod_pair[node_id] for node_id in group_nodes
      ]
  
      # apply memory stress
      chaos_config = gen_experiment_config(
          "./chaos_objects/memory_stress/chaos_replicas_memory_stress_pods.yaml"
      )
      chaos_config["spec"]["selector"]["pods"][
          "chaos-testing"
      ] = group_nodes_pod
      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(
          f"Apply memory stress on querynode {group_nodes}, pod {group_nodes_pod}"
      )
  
      duration = chaos_config.get("spec").get("duration")
      duration = (
          duration.replace("h", "*3600+")
          .replace("m", "*60+")
          .replace("s", "*1+")
          + "+0"
      )
      sleep(eval(duration))
  
      chaos_res.delete(
          metadata_name=chaos_config.get("metadata", None).get(
              "name", None
          )
      )
  
      # Verify auto load loadbalance
      seg_info_after, _ = utility_w.get_query_segment_info(
          collection_w.name
      )
      seg_distribution_before = cf.get_segment_distribution(
          seg_info_before
      )
      seg_distribution_after = cf.get_segment_distribution(
          seg_info_after
      )
      for node_id in group_nodes:
          assert len(seg_distribution_before[node_id]) == len(
              seg_distribution_after[node_id]
          )
  
      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 3 for calling the TestMemoryStressReplicaLoadBalance obj's underlying member method code with example usage: obj.test_memory_stress_replicas_cross_group_load_balance(prepare_collection) without return types