docstr: target: test compact without connection
  method: compact after remove connection
  expected: raise exception
docstr_tok: ["target",":","test","compact","without","connection","method",":","compact","after","remove","connection","expected",":","raise","exception"]
code: def test_compact_without_connection(self):
      """
      target: test compact without connection
      method: compact after remove connection
      expected: raise exception
      """
      # init collection with tmp_nb default data
      collection_w = self.init_collection_general(
          prefix, nb=tmp_nb, insert_data=True
      )[0]
  
      # remove connection and delete
      self.connection_wrap.remove_connection(ct.default_alias)
      res_list, _ = self.connection_wrap.list_connections()
      assert ct.default_alias not in res_list
      error = {
          ct.err_code: 0,
          ct.err_msg: "should create connect first",
      }
      collection_w.compact(
          check_task=CheckTasks.err_res, check_items=error
      )
  
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 1 for calling the TestCompactionParams obj's underlying member method code with example usage: obj.test_compact_without_connection() without return types