mirror of https://github.com/milvus-io/milvus.git
Update case
parent
0aa90ea91d
commit
394b763278
|
@ -42,16 +42,22 @@ def connect(request):
|
|||
port = request.config.getoption("--port")
|
||||
milvus = Milvus()
|
||||
try:
|
||||
milvus.connect(host=ip, port=port)
|
||||
except:
|
||||
status = milvus.connect(host=ip, port=port)
|
||||
logging.getLogger().info(status)
|
||||
if not status.OK():
|
||||
# try again
|
||||
logging.getLogger().info("------------------------------------")
|
||||
logging.getLogger().info("Try to connect again")
|
||||
logging.getLogger().info("------------------------------------")
|
||||
res = milvus.connect(host=ip, port=port)
|
||||
except Exception as e:
|
||||
logging.getLogger().error(str(e))
|
||||
pytest.exit("Milvus server can not connected, exit pytest ...")
|
||||
|
||||
def fin():
|
||||
try:
|
||||
milvus.disconnect()
|
||||
except:
|
||||
pass
|
||||
|
||||
request.addfinalizer(fin)
|
||||
return milvus
|
||||
|
||||
|
@ -129,4 +135,4 @@ def ip_table(request, connect):
|
|||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
return table_name
|
||||
return table_name
|
||||
|
|
|
@ -249,8 +249,8 @@ class TestConnect:
|
|||
'''
|
||||
milvus = Milvus()
|
||||
uri_value = "tcp://%s:19540" % args["ip"]
|
||||
milvus.connect(host=args["ip"], port="", uri=uri_value)
|
||||
assert milvus.connected()
|
||||
with pytest.raises(Exception) as e:
|
||||
milvus.connect(host=args["ip"], port="", uri=uri_value)
|
||||
|
||||
def test_connect_param_priority_uri(self, args):
|
||||
'''
|
||||
|
|
Loading…
Reference in New Issue