Add create_index test for test_bulk_insert.py

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/4973/head^2
zhenshan.cao 2021-01-08 09:47:01 +08:00 committed by yefu.chen
parent 6a3ec57fef
commit 0f3aa93666
4 changed files with 7 additions and 19 deletions

View File

@ -4,5 +4,5 @@ numpy==1.18.1
pytest==5.3.4
pytest-cov==2.8.1
pytest-timeout==1.3.4
pymilvus-distributed==0.0.10
pymilvus-distributed==0.0.14
sklearn==0.0

View File

@ -101,7 +101,6 @@ class TestInsertBase:
connect.flush([collection])
connect.drop_collection(collection)
@pytest.mark.skip("create index")
@pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_create_index(self, connect, collection, get_simple_index):
'''
@ -119,7 +118,6 @@ class TestInsertBase:
if field["name"] == field_name:
assert field["indexes"][0] == get_simple_index
@pytest.mark.skip("create index")
@pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_create_index_new(self, connect, collection, get_simple_index):
'''
@ -137,7 +135,6 @@ class TestInsertBase:
if field["name"] == field_name:
assert field["indexes"][0] == get_simple_index
@pytest.mark.skip("create index")
@pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_after_create_index(self, connect, collection, get_simple_index):
'''
@ -154,7 +151,6 @@ class TestInsertBase:
if field["name"] == field_name:
assert field["indexes"][0] == get_simple_index
# @pytest.mark.skip(" later ")
@pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_search(self, connect, collection):
'''
@ -645,7 +641,6 @@ class TestInsertBinary:
connect.flush([binary_collection])
assert connect.count_entities(binary_collection) == default_nb
@pytest.mark.skip("create index")
def test_insert_binary_after_create_index(self, connect, binary_collection, get_binary_index):
'''
target: test insert binary entities after build index
@ -662,7 +657,6 @@ class TestInsertBinary:
if field["name"] == binary_field_name:
assert field["indexes"][0] == get_binary_index
@pytest.mark.skip("create index")
@pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_binary_create_index(self, connect, binary_collection, get_binary_index):
'''
@ -863,7 +857,6 @@ class TestInsertMultiCollections:
connect.flush([collection_name])
assert len(ids) == 1
@pytest.mark.skip("create index")
@pytest.mark.timeout(ADD_TIMEOUT)
def test_create_index_insert_vector_another(self, connect, collection, get_simple_index):
'''
@ -877,7 +870,7 @@ class TestInsertMultiCollections:
ids = connect.bulk_insert(collection, default_entity)
connect.drop_collection(collection_name)
@pytest.mark.skip("create index")
@pytest.mark.skip("count entities")
@pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_vector_create_index_another(self, connect, collection, get_simple_index):
'''
@ -892,7 +885,7 @@ class TestInsertMultiCollections:
count = connect.count_entities(collection_name)
assert count == 0
@pytest.mark.skip("create index")
@pytest.mark.skip("count entities")
@pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_vector_sleep_create_index_another(self, connect, collection, get_simple_index):
'''

View File

@ -101,7 +101,6 @@ class TestInsertBase:
connect.flush([collection])
connect.drop_collection(collection)
@pytest.mark.skip("create_index")
@pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_create_index(self, connect, collection, get_simple_index):
'''
@ -119,7 +118,6 @@ class TestInsertBase:
if field["name"] == field_name:
assert field["indexes"][0] == get_simple_index
@pytest.mark.skip("create_index")
@pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_after_create_index(self, connect, collection, get_simple_index):
'''
@ -136,7 +134,6 @@ class TestInsertBase:
if field["name"] == field_name:
assert field["indexes"][0] == get_simple_index
@pytest.mark.skip(" todo fix search")
@pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_search(self, connect, collection):
'''
@ -313,7 +310,6 @@ class TestInsertBinary:
connect.flush([binary_collection])
assert connect.count_entities(binary_collection) == default_nb
@pytest.mark.skip("create index")
def test_insert_binary_after_create_index(self, connect, binary_collection, get_binary_index):
'''
target: test insert binary entities after build index
@ -330,7 +326,6 @@ class TestInsertBinary:
if field["name"] == binary_field_name:
assert field["indexes"][0] == get_binary_index
@pytest.mark.skip("create index")
@pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_binary_create_index(self, connect, binary_collection, get_binary_index):
'''

View File

@ -55,7 +55,7 @@ default_index_params = [
{"nlist": 128},
{"nlist": 128},
{"nlist": 128},
{"nlist": 128, "m": 16},
{"nlist": 128, "m": 16, "nbits": 8},
{"M": 48, "efConstruction": 500},
# {"search_length": 50, "out_degree": 40, "candidate_pool_size": 100, "knng": 50},
{"n_trees": 50},
@ -281,9 +281,9 @@ def gen_entities(nb, is_normal=False):
def gen_entities_new(nb, is_normal=False):
vectors = gen_vectors(nb, default_dim, is_normal)
entities = [
{"name": "int64", "values": [i for i in range(nb)]},
{"name": "float", "values": [float(i) for i in range(nb)]},
{"name": default_float_vec_field_name, "values": vectors}
{"name": "int64", "type": DataType.INT64, "values": [i for i in range(nb)]},
{"name": "float", "type": DataType.FLOAT, "values": [float(i) for i in range(nb)]},
{"name": default_float_vec_field_name, "type": DataType.FLOAT_VECTOR, "values": vectors}
]
return entities