test: adjust index timing (#31492)

index before insert

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
zhuwenxing 2024-03-22 09:09:11 +08:00 committed by GitHub
parent 09281a07f4
commit be68b84088
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,6 +20,20 @@ class TestE2e(TestcaseBase):
collection_w = self.init_collection_wrap(name=name, active_trace=True)
tt = time.time() - t0
assert collection_w.name == name
# index
index_params = {"index_type": "IVF_SQ8", "params": {"nlist": 64}, "metric_type": "L2"}
t0 = time.time()
index, _ = collection_w.create_index(field_name=ct.default_float_vec_field_name,
index_params=index_params,
index_name=cf.gen_unique_str())
index, _ = collection_w.create_index(field_name=ct.default_string_field_name,
index_params={},
index_name=cf.gen_unique_str())
tt = time.time() - t0
log.info(f"assert index: {tt}")
assert len(collection_w.indexes) == 2
entities = collection_w.num_entities
log.info(f"assert create collection: {tt}, init_entities: {entities}")
@ -40,19 +54,6 @@ class TestE2e(TestcaseBase):
entities = collection_w.num_entities
log.info(f"assert flush: {tt}, entities: {entities}")
# index
index_params = {"index_type": "IVF_SQ8", "params": {"nlist": 64}, "metric_type": "L2"}
t0 = time.time()
index, _ = collection_w.create_index(field_name=ct.default_float_vec_field_name,
index_params=index_params,
index_name=cf.gen_unique_str())
index, _ = collection_w.create_index(field_name=ct.default_string_field_name,
index_params={},
index_name=cf.gen_unique_str())
tt = time.time() - t0
log.info(f"assert index: {tt}")
assert len(collection_w.indexes) == 2
# load
collection_w.load()