class_docstr: ******************************************************************
    The following cases are used to test `create_partition` function 
  ******************************************************************
class_docstr_tok: ["*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","The","following","cases","are","used","to","test","`","create_partition","`","function","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*"]
docstr: target: verify server work after restart during compaction
  method: call function: create collection, then delete/flush/compacting, restart server and assert row count
      call `compact` again, compact pass
  expected: row count equals (nb - delete_length)
docstr_tok: ["target",":","verify","server","work","after","restart","during","compaction","method",":","call","function",":","create","collection",",","then","delete\/flush\/compacting",",","restart","server","and","assert","row","count","call","`","compact","`","again",",","compact","pass","expected",":","row","count","equals","(","nb","-","delete_length",")"]
code: def _test_delete_flush_during_compacting(
      self, connect, collection, args
  ):
      """
      target: verify server work after restart during compaction
      method: call function: create collection, then delete/flush/compacting, restart server and assert row count
          call `compact` again, compact pass
      expected: row count equals (nb - delete_length)
      """
      # disable_autoflush()
      ids = connect.bulk_insert(collection, big_entities)
      connect.flush([collection])
      delete_length = 1000
      loop = 10
      for i in range(loop):
          delete_ids = ids[i * delete_length : (i + 1) * delete_length]
          delete_res = connect.delete_entity_by_id(
              collection, delete_ids
          )
      connect.flush([collection])
      connect.compact(collection, _async=True)
      res_count = connect.count_entities(collection)
      logging.getLogger().info(res_count)
      assert res_count == big_nb - delete_length * loop
      info = connect.get_collection_stats(collection)
      size_old = info["partitions"][0]["segments"][0]["data_size"]
      logging.getLogger().info(size_old)
      # restart server
      assert restart_server(args["service_name"])
      # assert row count again
      new_connect = get_milvus(
          args["ip"], args["port"], handler=args["handler"]
      )
      res_count_2 = new_connect.count_entities(collection)
      logging.getLogger().info(res_count_2)
      assert res_count_2 == big_nb - delete_length * loop
      info = connect.get_collection_stats(collection)
      size_before = info["partitions"][0]["segments"][0]["data_size"]
      status = connect.compact(collection)
      assert status.OK()
      info = connect.get_collection_stats(collection)
      size_after = info["partitions"][0]["segments"][0]["data_size"]
      assert size_before > size_after
  
imports: import time
  import random
  import pdb
  import threading
  import logging
  import json
  from multiprocessing import Pool, Process
  import pytest
  from utils.util_pymilvus import get_milvus, restart_server, gen_entities, gen_unique_str, default_nb
  from common.constants import default_fields, default_entities
  from common.common_type import CaseLabel
label_desc: Use image node_id 7 for calling the TestRestartBase obj's underlying member method code with example usage: obj._test_delete_flush_during_compacting(connect, collection, args) without return types