docstr: target: test compact merge two segments
  method: 1.create with shard_num=1
          2.insert and flush
          3.insert and flush again
          4.compact
          5.load
  expected: Verify segments are merged
docstr_tok: ["target",":","test","compact","merge","two","segments","method",":","1.create","with","shard_num=1","2.insert","and","flush","3.insert","and","flush","again","4.compact","5.load","expected",":","Verify","segments","are","merged"]
code: def test_compact_merge_two_segments(self):
      """
      target: test compact merge two segments
      method: 1.create with shard_num=1
              2.insert and flush
              3.insert and flush again
              4.compact
              5.load
      expected: Verify segments are merged
      """
      num_of_segment = 2
      # create collection shard_num=1, insert 2 segments, each with tmp_nb entities
      collection_w = self.collection_insert_multi_segments_one_shard(
          prefix, num_of_segment, tmp_nb
      )
      collection_w.create_index(
          ct.default_float_vec_field_name, ct.default_index
      )
      log.debug(collection_w.index())
  
      collection_w.compact()
      collection_w.wait_for_compaction_completed()
      collection_w.get_compaction_plans(
          check_task=CheckTasks.check_merge_compact
      )
  
      # verify the two segments are merged into one
      c_plans = collection_w.get_compaction_plans()[0]
  
      # verify queryNode load the compacted segments
      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 merge two segments more than 180s"
              )
      assert c_plans.plans[0].target == segments_info[0].segmentID
  
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 11 for calling the TestCompactionOperation obj's underlying member method code with example usage: obj.test_compact_merge_two_segments() without return types