docstr: target: test num (segment_size < 1/2Max) reaches auto-merge threshold 10
  method: 1.create with shard_num=1
          2.insert flush 10 times (merge threshold 10)
          3.wait for compaction, load
  expected: Get query segments info to verify segments auto-merged into one
docstr_tok: ["target",":","test","num","(","segment_size","<","1\/2Max",")","reaches","auto-merge","threshold","10","method",":","1.create","with","shard_num=1","2.insert","flush","10","times","(","merge","threshold","10",")","3.wait","for","compaction",",","load","expected",":","Get","query","segments","info","to","verify","segments","auto-merged","into","one"]
code: def test_compact_threshold_auto_merge(self):
      """
      target: test num (segment_size < 1/2Max) reaches auto-merge threshold 10
      method: 1.create with shard_num=1
              2.insert flush 10 times (merge threshold 10)
              3.wait for compaction, load
      expected: Get query segments info to verify segments auto-merged into one
      """
      threshold = ct.compact_segment_num_threshold
  
      # create collection shard_num=1, insert 10 segments, each with one entity
      collection_w = self.collection_insert_multi_segments_one_shard(
          prefix, num_of_segment=threshold
      )
      collection_w.create_index(
          ct.default_float_vec_field_name, ct.default_index
      )
      log.debug(collection_w.index())
  
      # Estimated auto-merging takes 30s
      cost = 180
      collection_w.load()
      replicas = collection_w.get_replicas()[0]
      replica_num = len(replicas.groups)
      start = time()
      while True:
          sleep(1)
          segments_info = self.utility_wrap.get_query_segment_info(
              collection_w.name
          )[0]
  
          # verify segments reaches threshold, auto-merge ten segments into one
          if len(segments_info) == 1 * replica_num:
              break
          end = time()
          if end - start > cost:
              raise MilvusException(
                  1, "Compact auto-merge more than 180s"
              )
  
imports: import threading
  from time import time, sleep
  import pytest
  from pymilvus.grpc_gen.common_pb2 import SegmentState
  from pymilvus.exceptions import MilvusException
  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_log import test_log
label_desc: Use image node_id 15 for calling the TestCompactionOperation obj's underlying member method code with example usage: obj.test_compact_threshold_auto_merge() without return types