docstr: target: test delete one entity and compact
  method: 1.create with shard_num=1
          2.delete one sealed entity, half entities
          2.compact
  expected: Verify compact result
docstr_tok: ["target",":","test","delete","one","entity","and","compact","method",":","1.create","with","shard_num=1","2.delete","one","sealed","entity",",","half","entities","2.compact","expected",":","Verify","compact","result"]
code: def test_compact_after_delete(self, delete_pos):
      """
      target: test delete one entity and compact
      method: 1.create with shard_num=1
              2.delete one sealed entity, half entities
              2.compact
      expected: Verify compact result
      """
      # create, insert without flush
      collection_w = self.init_collection_wrap(
          cf.gen_unique_str(prefix), shards_num=1
      )
      df = cf.gen_default_dataframe_data(tmp_nb)
      insert_res, _ = collection_w.insert(df)
  
      # delete single entity, flush
      single_expr = f"{ct.default_int64_field_name} in {insert_res.primary_keys[:delete_pos]}"
      collection_w.delete(single_expr)
      collection_w.flush()
  
      # compact, get plan
      sleep(ct.compact_retention_duration + 1)
      collection_w.compact()
      collection_w.wait_for_compaction_completed()
      collection_w.get_compaction_plans(
          check_task=CheckTasks.check_delete_compact
      )
  
      collection_w.load()
      collection_w.query(
          single_expr, check_items=CheckTasks.check_query_empty
      )
  
      res = df.iloc[-1:, :1].to_dict("records")
      collection_w.query(
          f"{ct.default_int64_field_name} in {insert_res.primary_keys[-1:]}",
          check_items={"exp_res": res},
      )
  
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 6 for calling the TestCompactionParams obj's underlying member method code with example usage: obj.test_compact_after_delete(delete_pos) without return types