docstr: Method：
  1. prepare a collection with multi segments
  2. create rgA and rgB
  3. transfer 2 nodes to rgA and 3 nodes to rgB
  4. load 3 replicas in rgA and rgB
  verify load fail with msg
  5. load 1 replica in rgA and rgB
  verify load fail with msg
  6. load 2 replica in rgA and rgB
  verify load succ and each replica occupies one rg
  7. verify load successfully again with no parameters
docstr_tok: ["Method\uff1a","1.","prepare","a","collection","with","multi","segments","2.","create","rgA","and","rgB","3.","transfer","2","nodes","to","rgA","and","3","nodes","to","rgB","4.","load","3","replicas","in","rgA","and","rgB","verify","load","fail","with","msg","5.","load","1","replica","in","rgA","and","rgB","verify","load","fail","with","msg","6.","load","2","replica","in","rgA","and","rgB","verify","load","succ","and","each","replica","occupies","one","rg","7.","verify","load","successfully","again","with","no","parameters"]
code: def test_load_with_replicas_and_rgs_num(self, with_growing):
      """
      Method：
      1. prepare a collection with multi segments
      2. create rgA and rgB
      3. transfer 2 nodes to rgA and 3 nodes to rgB
      4. load 3 replicas in rgA and rgB
      verify load fail with msg
      5. load 1 replica in rgA and rgB
      verify load fail with msg
      6. load 2 replica in rgA and rgB
      verify load succ and each replica occupies one rg
      7. verify load successfully again with no parameters
      """
      # prepare a collection with segments
      dim = 128
      collection_w = self.init_collection_wrap(shards_num=2)
      insert_ids = []
      nb = 3000
      for i in range(5):
          res, _ = collection_w.insert(
              cf.gen_default_list_data(nb=nb, dim=dim, start=i * nb)
          )
          collection_w.flush()
          insert_ids.extend(res.primary_keys)
      collection_w.create_index(
          ct.default_float_vec_field_name, ct.default_flat_index
      )
  
      # make growing
      if with_growing:
          res, _ = collection_w.insert(
              cf.gen_default_list_data(nb, dim=dim, start=6 * nb)
          )
          insert_ids.extend(res.primary_keys)
  
      # create rgA and rgB
      rgA_name = cf.gen_unique_str("rgA")
      self.init_resource_group(name=rgA_name)
      rgB_name = cf.gen_unique_str("rgB")
      self.init_resource_group(name=rgB_name)
      # transfer 2 nodes to rgA and 3 nodes to rgB
      num_nodes_rgA = 2
      self.utility_wrap.transfer_node(
          source=ct.default_resource_group_name,
          target=rgA_name,
          num_node=num_nodes_rgA,
      )
      num_nodes_rgB = 3
      self.utility_wrap.transfer_node(
          source=ct.default_resource_group_name,
          target=rgB_name,
          num_node=num_nodes_rgB,
      )
      # load 3 replicas in rgA and rgB
      replica_number = 3
      error = {
          ct.err_code: 999,
          ct.err_msg: "failed to load collection, err=failed to spawn replica for collection[resource group num can only be 0, 1 or same as replica number]",
      }
      collection_w.load(
          replica_number=replica_number,
          _resource_groups=[rgA_name, rgB_name],
          check_task=CheckTasks.err_res,
          check_items=error,
      )
  
      # load 1 replica in rgA and rgB
      replica_number = 1
      collection_w.load(
          replica_number=replica_number,
          _resource_groups=[rgA_name, rgB_name],
          check_task=CheckTasks.err_res,
          check_items=error,
      )
  
      # load 2 replica in rgA and rgB
      replica_number = 2
      collection_w.load(
          replica_number=replica_number,
          _resource_groups=[rgA_name, rgB_name],
      )
      # verify replica state: each replica occupies one rg
      replicas = collection_w.get_replicas()
      assert len(replicas[0].groups) == replica_number
      for rep in replicas[0].groups:
          assert rep.num_outbound_node == {}
          assert rep.resource_group in [rgA_name, rgB_name]
          if rep.resource_group == rgA_name:
              assert (
                  len(rep.group_nodes) == num_nodes_rgA
              )  # one replica for each rg
          else:
              assert (
                  len(rep.group_nodes) == num_nodes_rgB
              )  # one replica for each rg
  
      # verify get segment info return not empty
      segments_info = self.utility_wrap.get_query_segment_info(
          collection_name=collection_w.name
      )[0]
      assert len(segments_info) > 0
  
      # make growing
      if with_growing:
          res, _ = collection_w.insert(
              cf.gen_default_list_data(nb=200, dim=dim, start=8 * nb)
          )
          insert_ids.extend(res.primary_keys)
  
      # verify search succ
      nq = 5
      vectors = [
          [random.random() for _ in range(dim)] for _ in range(nq)
      ]
      collection_w.search(
          vectors[:nq],
          ct.default_float_vec_field_name,
          ct.default_search_params,
          ct.default_limit,
          check_task=CheckTasks.check_search_results,
          check_items={
              "nq": nq,
              "ids": insert_ids.copy(),
              "limit": ct.default_limit,
          },
      )
      # verify load successfully again with no parameters
      collection_w.load(replica_number=2)
      collection_w.search(
          vectors[:nq],
          ct.default_float_vec_field_name,
          ct.default_search_params,
          ct.default_limit,
          check_task=CheckTasks.check_search_results,
          check_items={
              "nq": nq,
              "ids": insert_ids.copy(),
              "limit": ct.default_limit,
          },
      )
  
imports: import pytest
  from base.client_base import TestcaseBase
  from common import common_func
  from common import common_type
  from common.common_type import CaseLabel, CheckTasks
  from utils.util_pymilvus import *
label_desc: Use image node_id 3 for calling the TestResourceGroupMultiNodes obj's underlying member method code with example usage: obj.test_load_with_replicas_and_rgs_num(with_growing) without return types