docstr: target: test auto compact with max interval 60s
  method: 1.create with shard_num=1
          2.insert flush twice (two segments)
          3.wait max_compaction_interval (60s)
  expected: Verify compaction results
docstr_tok: ["target",":","test","auto","compact","with","max","interval","60s","method",":","1.create","with","shard_num=1","2.insert","flush","twice","(","two","segments",")","3.wait","max_compaction_interval","(","60s",")","expected",":","Verify","compaction","results"]
code: def test_compact_max_time_interval(self):
      """
      target: test auto compact with max interval 60s
      method: 1.create with shard_num=1
              2.insert flush twice (two segments)
              3.wait max_compaction_interval (60s)
      expected: Verify compaction results
      """
      # create collection shard_num=1, insert 2 segments, each with tmp_nb entities
      collection_w = self.init_collection_wrap(
          name=cf.gen_unique_str(prefix), shards_num=1
      )
      collection_w.create_index(
          ct.default_float_vec_field_name, ct.default_index
      )
      collection_w.compact()
  
      # Notice:The merge segments compaction triggered by max_compaction_interval also needs to meet
      # the compaction_segment_ num_threshold
      for i in range(ct.compact_segment_num_threshold):
          df = cf.gen_default_dataframe_data(tmp_nb)
          collection_w.insert(df)
          assert collection_w.num_entities == tmp_nb * (i + 1)
  
      sleep(ct.max_compaction_interval + 1)
  
      # verify queryNode load the compacted segments
      collection_w.load()
      replicas = collection_w.get_replicas()[0]
      replica_num = len(replicas.groups)
      cost = 180
      start = time()
      while time() - start < cost:
          sleep(1.0)
          collection_w.load()
          segment_info = self.utility_wrap.get_query_segment_info(
              collection_w.name
          )[0]
          if len(segment_info) == 1 * replica_num:
              break
          if time() - start > cost:
              raise MilvusException(
                  1,
                  f"Waiting more than {cost}s for the compacted segment indexed",
              )
          collection_w.release()
  
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 13 for calling the TestCompactionParams obj's underlying member method code with example usage: obj.test_compact_max_time_interval() without return types