docstr: target: test insert after compact
  method: 1.create and insert with flush
          2.delete and compact
          3.insert new data
          4.load and search
  expected: Verify search result and segment info
docstr_tok: ["target",":","test","insert","after","compact","method",":","1.create","and","insert","with","flush","2.delete","and","compact","3.insert","new","data","4.load","and","search","expected",":","Verify","search","result","and","segment","info"]
code: def test_compact_and_insert(self):
      """
      target: test insert after compact
      method: 1.create and insert with flush
              2.delete and compact
              3.insert new data
              4.load and search
      expected: Verify search result and segment info
      """
      # create collection shard_num=1, insert 2 segments, each with tmp_nb entities
      collection_w = self.collection_insert_multi_segments_one_shard(
          prefix, nb_of_segment=tmp_nb
      )
  
      # compact two segments
      collection_w.compact()
      collection_w.wait_for_compaction_completed()
      collection_w.get_compaction_plans()
  
      # insert new data, verify insert flush successfully
      df = cf.gen_default_dataframe_data(tmp_nb)
      collection_w.insert(df)
      assert collection_w.num_entities == tmp_nb * 3
  
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 18 for calling the TestCompactionOperation obj's underlying member method code with example usage: obj.test_compact_and_insert() without return types