提交 0f3aa936 编写于 作者: Z zhenshan.cao 提交者: yefu.chen

Add create_index test for test_bulk_insert.py

Signed-off-by: Nzhenshan.cao <zhenshan.cao@zilliz.com>
上级 6a3ec57f
...@@ -4,5 +4,5 @@ numpy==1.18.1 ...@@ -4,5 +4,5 @@ numpy==1.18.1
pytest==5.3.4 pytest==5.3.4
pytest-cov==2.8.1 pytest-cov==2.8.1
pytest-timeout==1.3.4 pytest-timeout==1.3.4
pymilvus-distributed==0.0.10 pymilvus-distributed==0.0.14
sklearn==0.0 sklearn==0.0
...@@ -101,7 +101,6 @@ class TestInsertBase: ...@@ -101,7 +101,6 @@ class TestInsertBase:
connect.flush([collection]) connect.flush([collection])
connect.drop_collection(collection) connect.drop_collection(collection)
@pytest.mark.skip("create index")
@pytest.mark.timeout(ADD_TIMEOUT) @pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_create_index(self, connect, collection, get_simple_index): def test_insert_create_index(self, connect, collection, get_simple_index):
''' '''
...@@ -119,7 +118,6 @@ class TestInsertBase: ...@@ -119,7 +118,6 @@ class TestInsertBase:
if field["name"] == field_name: if field["name"] == field_name:
assert field["indexes"][0] == get_simple_index assert field["indexes"][0] == get_simple_index
@pytest.mark.skip("create index")
@pytest.mark.timeout(ADD_TIMEOUT) @pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_create_index_new(self, connect, collection, get_simple_index): def test_insert_create_index_new(self, connect, collection, get_simple_index):
''' '''
...@@ -137,7 +135,6 @@ class TestInsertBase: ...@@ -137,7 +135,6 @@ class TestInsertBase:
if field["name"] == field_name: if field["name"] == field_name:
assert field["indexes"][0] == get_simple_index assert field["indexes"][0] == get_simple_index
@pytest.mark.skip("create index")
@pytest.mark.timeout(ADD_TIMEOUT) @pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_after_create_index(self, connect, collection, get_simple_index): def test_insert_after_create_index(self, connect, collection, get_simple_index):
''' '''
...@@ -154,7 +151,6 @@ class TestInsertBase: ...@@ -154,7 +151,6 @@ class TestInsertBase:
if field["name"] == field_name: if field["name"] == field_name:
assert field["indexes"][0] == get_simple_index assert field["indexes"][0] == get_simple_index
# @pytest.mark.skip(" later ")
@pytest.mark.timeout(ADD_TIMEOUT) @pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_search(self, connect, collection): def test_insert_search(self, connect, collection):
''' '''
...@@ -645,7 +641,6 @@ class TestInsertBinary: ...@@ -645,7 +641,6 @@ class TestInsertBinary:
connect.flush([binary_collection]) connect.flush([binary_collection])
assert connect.count_entities(binary_collection) == default_nb 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): def test_insert_binary_after_create_index(self, connect, binary_collection, get_binary_index):
''' '''
target: test insert binary entities after build index target: test insert binary entities after build index
...@@ -662,7 +657,6 @@ class TestInsertBinary: ...@@ -662,7 +657,6 @@ class TestInsertBinary:
if field["name"] == binary_field_name: if field["name"] == binary_field_name:
assert field["indexes"][0] == get_binary_index assert field["indexes"][0] == get_binary_index
@pytest.mark.skip("create index")
@pytest.mark.timeout(ADD_TIMEOUT) @pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_binary_create_index(self, connect, binary_collection, get_binary_index): def test_insert_binary_create_index(self, connect, binary_collection, get_binary_index):
''' '''
...@@ -863,7 +857,6 @@ class TestInsertMultiCollections: ...@@ -863,7 +857,6 @@ class TestInsertMultiCollections:
connect.flush([collection_name]) connect.flush([collection_name])
assert len(ids) == 1 assert len(ids) == 1
@pytest.mark.skip("create index")
@pytest.mark.timeout(ADD_TIMEOUT) @pytest.mark.timeout(ADD_TIMEOUT)
def test_create_index_insert_vector_another(self, connect, collection, get_simple_index): def test_create_index_insert_vector_another(self, connect, collection, get_simple_index):
''' '''
...@@ -877,7 +870,7 @@ class TestInsertMultiCollections: ...@@ -877,7 +870,7 @@ class TestInsertMultiCollections:
ids = connect.bulk_insert(collection, default_entity) ids = connect.bulk_insert(collection, default_entity)
connect.drop_collection(collection_name) connect.drop_collection(collection_name)
@pytest.mark.skip("create index") @pytest.mark.skip("count entities")
@pytest.mark.timeout(ADD_TIMEOUT) @pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_vector_create_index_another(self, connect, collection, get_simple_index): def test_insert_vector_create_index_another(self, connect, collection, get_simple_index):
''' '''
...@@ -892,7 +885,7 @@ class TestInsertMultiCollections: ...@@ -892,7 +885,7 @@ class TestInsertMultiCollections:
count = connect.count_entities(collection_name) count = connect.count_entities(collection_name)
assert count == 0 assert count == 0
@pytest.mark.skip("create index") @pytest.mark.skip("count entities")
@pytest.mark.timeout(ADD_TIMEOUT) @pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_vector_sleep_create_index_another(self, connect, collection, get_simple_index): def test_insert_vector_sleep_create_index_another(self, connect, collection, get_simple_index):
''' '''
......
...@@ -101,7 +101,6 @@ class TestInsertBase: ...@@ -101,7 +101,6 @@ class TestInsertBase:
connect.flush([collection]) connect.flush([collection])
connect.drop_collection(collection) connect.drop_collection(collection)
@pytest.mark.skip("create_index")
@pytest.mark.timeout(ADD_TIMEOUT) @pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_create_index(self, connect, collection, get_simple_index): def test_insert_create_index(self, connect, collection, get_simple_index):
''' '''
...@@ -119,7 +118,6 @@ class TestInsertBase: ...@@ -119,7 +118,6 @@ class TestInsertBase:
if field["name"] == field_name: if field["name"] == field_name:
assert field["indexes"][0] == get_simple_index assert field["indexes"][0] == get_simple_index
@pytest.mark.skip("create_index")
@pytest.mark.timeout(ADD_TIMEOUT) @pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_after_create_index(self, connect, collection, get_simple_index): def test_insert_after_create_index(self, connect, collection, get_simple_index):
''' '''
...@@ -136,7 +134,6 @@ class TestInsertBase: ...@@ -136,7 +134,6 @@ class TestInsertBase:
if field["name"] == field_name: if field["name"] == field_name:
assert field["indexes"][0] == get_simple_index assert field["indexes"][0] == get_simple_index
@pytest.mark.skip(" todo fix search")
@pytest.mark.timeout(ADD_TIMEOUT) @pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_search(self, connect, collection): def test_insert_search(self, connect, collection):
''' '''
...@@ -313,7 +310,6 @@ class TestInsertBinary: ...@@ -313,7 +310,6 @@ class TestInsertBinary:
connect.flush([binary_collection]) connect.flush([binary_collection])
assert connect.count_entities(binary_collection) == default_nb 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): def test_insert_binary_after_create_index(self, connect, binary_collection, get_binary_index):
''' '''
target: test insert binary entities after build index target: test insert binary entities after build index
...@@ -330,7 +326,6 @@ class TestInsertBinary: ...@@ -330,7 +326,6 @@ class TestInsertBinary:
if field["name"] == binary_field_name: if field["name"] == binary_field_name:
assert field["indexes"][0] == get_binary_index assert field["indexes"][0] == get_binary_index
@pytest.mark.skip("create index")
@pytest.mark.timeout(ADD_TIMEOUT) @pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_binary_create_index(self, connect, binary_collection, get_binary_index): def test_insert_binary_create_index(self, connect, binary_collection, get_binary_index):
''' '''
......
...@@ -55,7 +55,7 @@ default_index_params = [ ...@@ -55,7 +55,7 @@ default_index_params = [
{"nlist": 128}, {"nlist": 128},
{"nlist": 128}, {"nlist": 128},
{"nlist": 128}, {"nlist": 128},
{"nlist": 128, "m": 16}, {"nlist": 128, "m": 16, "nbits": 8},
{"M": 48, "efConstruction": 500}, {"M": 48, "efConstruction": 500},
# {"search_length": 50, "out_degree": 40, "candidate_pool_size": 100, "knng": 50}, # {"search_length": 50, "out_degree": 40, "candidate_pool_size": 100, "knng": 50},
{"n_trees": 50}, {"n_trees": 50},
...@@ -281,9 +281,9 @@ def gen_entities(nb, is_normal=False): ...@@ -281,9 +281,9 @@ def gen_entities(nb, is_normal=False):
def gen_entities_new(nb, is_normal=False): def gen_entities_new(nb, is_normal=False):
vectors = gen_vectors(nb, default_dim, is_normal) vectors = gen_vectors(nb, default_dim, is_normal)
entities = [ entities = [
{"name": "int64", "values": [i for i in range(nb)]}, {"name": "int64", "type": DataType.INT64, "values": [i for i in range(nb)]},
{"name": "float", "values": [float(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, "values": vectors} {"name": default_float_vec_field_name, "type": DataType.FLOAT_VECTOR, "values": vectors}
] ]
return entities return entities
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册