mirror of https://github.com/milvus-io/milvus.git
parent
dec0b40a66
commit
22063c6d8a
|
@ -165,7 +165,7 @@ class TestCreateCollection:
|
|||
connect.create_collection(collection_name, default_fields)
|
||||
|
||||
for i in range(threads_num):
|
||||
t = TestThread(target=create, args=())
|
||||
t = MyThread(target=create, args=())
|
||||
threads.append(t)
|
||||
t.start()
|
||||
time.sleep(0.2)
|
||||
|
|
|
@ -121,7 +121,7 @@ class TestDescribeCollection:
|
|||
connect.describe_collection(collection_name)
|
||||
|
||||
for i in range(threads_num):
|
||||
t = TestThread(target=get_info)
|
||||
t = MyThread(target=get_info)
|
||||
threads.append(t)
|
||||
t.start()
|
||||
time.sleep(0.2)
|
||||
|
|
|
@ -74,7 +74,7 @@ class TestDropCollection:
|
|||
connect.create_collection(collection_name, default_fields)
|
||||
connect.drop_collection(collection_name)
|
||||
for i in range(threads_num):
|
||||
t = TestThread(target=create, args=())
|
||||
t = MyThread(target=create, args=())
|
||||
threads.append(t)
|
||||
t.start()
|
||||
time.sleep(0.2)
|
||||
|
|
|
@ -68,7 +68,7 @@ class TestHasCollection:
|
|||
assert connect.has_collection(collection_name)
|
||||
# assert not assert_collection(connect, collection_name)
|
||||
for i in range(threads_num):
|
||||
t = TestThread(target=has, args=())
|
||||
t = MyThread(target=has, args=())
|
||||
threads.append(t)
|
||||
t.start()
|
||||
time.sleep(0.2)
|
||||
|
|
|
@ -91,7 +91,7 @@ class TestListCollections:
|
|||
assert collection_name in connect.list_collections()
|
||||
|
||||
for i in range(threads_num):
|
||||
t = TestThread(target=_list)
|
||||
t = MyThread(target=_list)
|
||||
threads.append(t)
|
||||
t.start()
|
||||
time.sleep(0.2)
|
||||
|
|
|
@ -883,7 +883,7 @@ class TestSearchBase:
|
|||
|
||||
for i in range(threads_num):
|
||||
milvus = get_milvus(args["ip"], args["port"], handler=args["handler"])
|
||||
t = TestThread(target=search, args=(milvus,))
|
||||
t = MyThread(target=search, args=(milvus,))
|
||||
threads.append(t)
|
||||
t.start()
|
||||
time.sleep(0.2)
|
||||
|
@ -918,7 +918,7 @@ class TestSearchBase:
|
|||
assert res[0]._distances[0] < epsilon
|
||||
|
||||
for i in range(threads_num):
|
||||
t = TestThread(target=search, args=(milvus,))
|
||||
t = MyThread(target=search, args=(milvus,))
|
||||
threads.append(t)
|
||||
t.start()
|
||||
time.sleep(0.2)
|
||||
|
|
|
@ -269,7 +269,7 @@ class TestFlushBase:
|
|||
milvus.flush([collection])
|
||||
logging.error("end flush")
|
||||
|
||||
p = TestThread(target=flush, args=())
|
||||
p = MyThread(target=flush, args=())
|
||||
p.start()
|
||||
time.sleep(0.2)
|
||||
logging.error("start count")
|
||||
|
|
|
@ -170,7 +170,7 @@ class TestIndexBase:
|
|||
threads = []
|
||||
for i in range(threads_num):
|
||||
m = get_milvus(host=args["ip"], port=args["port"], handler=args["handler"])
|
||||
t = TestThread(target=build, args=(m,))
|
||||
t = MyThread(target=build, args=(m,))
|
||||
threads.append(t)
|
||||
t.start()
|
||||
time.sleep(0.2)
|
||||
|
@ -330,7 +330,7 @@ class TestIndexBase:
|
|||
threads = []
|
||||
for i in range(threads_num):
|
||||
m = get_milvus(host=args["ip"], port=args["port"], handler=args["handler"])
|
||||
t = TestThread(target=build, args=(m,))
|
||||
t = MyThread(target=build, args=(m,))
|
||||
threads.append(t)
|
||||
t.start()
|
||||
time.sleep(0.2)
|
||||
|
|
|
@ -989,19 +989,19 @@ def compare_list_elements(_first, _second):
|
|||
return True
|
||||
|
||||
|
||||
class TestThread(threading.Thread):
|
||||
class MyThread(threading.Thread):
|
||||
def __init__(self, target, args=()):
|
||||
threading.Thread.__init__(self, target=target, args=args)
|
||||
|
||||
def run(self):
|
||||
self.exc = None
|
||||
try:
|
||||
super(TestThread, self).run()
|
||||
super(MyThread, self).run()
|
||||
except BaseException as e:
|
||||
self.exc = e
|
||||
logging.error(traceback.format_exc())
|
||||
|
||||
def join(self):
|
||||
super(TestThread, self).join()
|
||||
super(MyThread, self).join()
|
||||
if self.exc:
|
||||
raise self.exc
|
||||
|
|
Loading…
Reference in New Issue