docstr: target: test compact manual and auto
  method: 1.create with shard_num=1
          2.insert one and flush (11 times)
          3.compact
          4.load and search
  expected: Verify segments info
docstr_tok: ["target",":","test","compact","manual","and","auto","method",":","1.create","with","shard_num=1","2.insert","one","and","flush","(","11","times",")","3.compact","4.load","and","search","expected",":","Verify","segments","info"]
code: def test_compact_manual_and_auto(self):
      """
      target: test compact manual and auto
      method: 1.create with shard_num=1
              2.insert one and flush (11 times)
              3.compact
              4.load and search
      expected: Verify segments info
      """
      # greater than auto-merge threshold 10
      pytest.skip(
          "DataCoord: for A, B -> C, will not compact segment C before A, B GCed, no method to check whether a segment is GCed"
      )
      num_of_segment = ct.compact_segment_num_threshold + 1
  
      # create collection shard_num=1, insert 11 segments, each with one entity
      collection_w = self.collection_insert_multi_segments_one_shard(
          prefix, num_of_segment=num_of_segment
      )
      collection_w.create_index(
          ct.default_float_vec_field_name, ct.default_index
      )
      log.debug(collection_w.index())
  
      # waiting for auto compaction finished
      sleep(60)
  
      collection_w.compact()
      collection_w.wait_for_compaction_completed()
      c_plans, _ = collection_w.get_compaction_plans(
          check_task=CheckTasks.check_merge_compact,
          check_items={"segment_num": 2},
      )
  
      collection_w.load()
      start = time()
      cost = 180
      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:
              break
          end = time()
          if end - start > cost:
              raise MilvusException(
                  1, "Compact auto and manual more than 180s"
              )
      assert segments_info[0].segmentID == c_plans.plans[0].target
  
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 13 for calling the TestCompactionOperation obj's underlying member method code with example usage: obj.test_compact_manual_and_auto() without return types