[skip ci] Update pymilvus-orm version (#6284)

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
pull/6278/head
yanliang567 2021-07-03 10:02:17 +08:00 committed by GitHub
parent 8dd2051a9a
commit 8259404576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 35 deletions

View File

@ -21,6 +21,9 @@ class Op(Enum):
unknown = 'unknown'
timeout = 20
class Checker:
def __init__(self):
self._succ = 0
@ -28,9 +31,10 @@ class Checker:
self._running = True
self.c_wrap = ApiCollectionWrapper()
self.c_wrap.init_collection(name=cf.gen_unique_str('Checker_'),
schema=cf.gen_default_collection_schema())
schema=cf.gen_default_collection_schema(),
timeout=timeout)
self.c_wrap.insert(data=cf.gen_default_list_data(nb=constants.ENTITIES_FOR_SEARCH),
check_task='check_nothing')
timeout=timeout, check_task='check_nothing')
self.initial_entities = self.c_wrap.num_entities # do as a flush
def total(self):
@ -59,7 +63,7 @@ class SearchChecker(Checker):
data=search_vec,
anns_field=ct.default_float_vec_field_name,
param={"nprobe": 32},
limit=1, check_task='check_nothing'
limit=1, timeout=timeout, check_task='check_nothing'
)
if result:
self._succ += 1
@ -78,7 +82,7 @@ class InsertFlushChecker(Checker):
init_entities = self.c_wrap.num_entities
_, insert_result = \
self.c_wrap.insert(data=cf.gen_default_list_data(nb=constants.DELTA_PER_INS),
check_task='check_nothing')
timeout=timeout, check_task='check_nothing')
if not self._flush:
if insert_result:
self._succ += 1
@ -101,11 +105,11 @@ class CreateChecker(Checker):
_, result = self.c_wrap.init_collection(
name=cf.gen_unique_str("CreateChecker_"),
schema=cf.gen_default_collection_schema(),
check_task='check_nothing'
timeout=timeout, check_task='check_nothing'
)
if result:
self._succ += 1
self.c_wrap.drop(check_task="check_nothing")
self.c_wrap.drop(timeout=timeout, check_task="check_nothing")
else:
self._fail += 1
sleep(constants.WAIT_PER_OP / 10)
@ -115,7 +119,7 @@ class IndexChecker(Checker):
def __init__(self):
super().__init__()
self.c_wrap.insert(data=cf.gen_default_list_data(nb=5*constants.ENTITIES_FOR_SEARCH),
check_task='check_nothing')
timeout=timeout, check_task='check_nothing')
log.debug(f"Index ready entities: {self.c_wrap.num_entities }") # do as a flush before indexing
def keep_running(self):
@ -123,10 +127,10 @@ class IndexChecker(Checker):
_, result = self.c_wrap.create_index(ct.default_float_vec_field_name,
constants.DEFAULT_INDEX_PARAM,
name=cf.gen_unique_str('index_'),
check_task='check_nothing')
timeout=timeout, check_task='check_nothing')
if result:
self._succ += 1
self.c_wrap.drop_index(check_task='check_nothing')
self.c_wrap.drop_index(timeout=timeout, check_task='check_nothing')
else:
self._fail += 1
@ -142,33 +146,9 @@ class QueryChecker(Checker):
for _ in range(5):
int_values.append(randint(0, constants.ENTITIES_FOR_SEARCH))
term_expr = f'{ct.default_int64_field_name} in {int_values}'
_, result = self.c_wrap.query(term_expr, check_task='check_nothing')
_, result = self.c_wrap.query(term_expr, timeout=timeout, check_task='check_nothing')
if result:
self._succ += 1
else:
self._fail += 1
sleep(constants.WAIT_PER_OP / 10)
#
# if __name__ == '__main__':
# from pymilvus_orm import connections
# connections.add_connection(default={"host": '10.98.0.7', "port": 19530})
# conn = connections.connect(alias='default')
# c_w = ApiCollectionWrapper()
# c_w.init_collection(name=cf.gen_unique_str("collection_4_search_"),
# schema=cf.gen_default_collection_schema())
# c_w.insert(data=cf.gen_default_list_data(nb=constants.ENTITIES_FOR_SEARCH))
# log.debug(f"nums: {c_w.num_entities}")
# # c_w.load()
# # # int_values = []
# # # for _ in range(5):
# # # int_values.append(randint(0, constants.ENTITIES_FOR_SEARCH))
# # term_expr = f'{ct.default_int64_field_name} in [1,2,3,4,5]'
# # log.debug(term_expr)
# # res, result = c_w.query(term_expr)
#
# res, result = c_w.create_index(ct.default_float_vec_field_name,
# constants.DEFAULT_INDEX_PARAM,
# name=cf.gen_unique_str('index_'),
# check_task='check_nothing')
# log.debug(res)

View File

@ -12,7 +12,7 @@ pytest-print==0.2.1
pytest-level==0.1.1
pytest-xdist==2.2.1
pytest-parallel
pymilvus-orm==2.0.0rc2.dev16
pymilvus-orm==2.0.0rc2.dev17
pytest-rerunfailures==9.1.1
git+https://github.com/Projectplace/pytest-tags
ndg-httpsclient