diff --git a/tests/python_test/collection/test_create_collection.py b/tests/python_test/collection/test_create_collection.py index 2a3f1a9fe053020fefd0df1ad3e2ba54f2d430e6..cf6150ff82fb56d57a18bf7422ef0fcfaea4e529 100644 --- a/tests/python_test/collection/test_create_collection.py +++ b/tests/python_test/collection/test_create_collection.py @@ -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) diff --git a/tests/python_test/collection/test_describe_collection.py b/tests/python_test/collection/test_describe_collection.py index f441cdb43605de167af80bf56fce95f204c6efbe..7ff0087c288b12a903b637dc1654432858975e4c 100644 --- a/tests/python_test/collection/test_describe_collection.py +++ b/tests/python_test/collection/test_describe_collection.py @@ -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) diff --git a/tests/python_test/collection/test_drop_collection.py b/tests/python_test/collection/test_drop_collection.py index f3fe56c3b7db6670a9ee5e515c2d4cf1048037f8..e14be1992202d4f4783c08f17d37e085fb49ac3c 100644 --- a/tests/python_test/collection/test_drop_collection.py +++ b/tests/python_test/collection/test_drop_collection.py @@ -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) diff --git a/tests/python_test/collection/test_has_collection.py b/tests/python_test/collection/test_has_collection.py index 688cbd9f3490e0e63749ebad155f9b837dea97cb..c2db0084c8764eb592fc6befe89d2db74f8862b3 100644 --- a/tests/python_test/collection/test_has_collection.py +++ b/tests/python_test/collection/test_has_collection.py @@ -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) diff --git a/tests/python_test/collection/test_list_collections.py b/tests/python_test/collection/test_list_collections.py index a150efbdcf2d78a44e3b82144ff659059303c153..42d4cf5b2221a3a7ea06ba4f41959ba300bc6c5e 100644 --- a/tests/python_test/collection/test_list_collections.py +++ b/tests/python_test/collection/test_list_collections.py @@ -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) diff --git a/tests/python_test/entity/test_search.py b/tests/python_test/entity/test_search.py index 263da5b6f10f931338c409e962f3050afe3e6931..34d03b670ed13535b17b50f65b7e4db7eda4bd17 100644 --- a/tests/python_test/entity/test_search.py +++ b/tests/python_test/entity/test_search.py @@ -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) diff --git a/tests/python_test/test_flush.py b/tests/python_test/test_flush.py index 40a914abef0f8c767508b460c181b359437f92c6..ccd02834560112889a25170297a6c6783f1c4987 100644 --- a/tests/python_test/test_flush.py +++ b/tests/python_test/test_flush.py @@ -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") diff --git a/tests/python_test/test_index.py b/tests/python_test/test_index.py index e121dd4b5a2019cb7de03dec2ca677a93f34787f..021ab65e62f87b5ddae34ae41263271b4c9ba89d 100644 --- a/tests/python_test/test_index.py +++ b/tests/python_test/test_index.py @@ -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) diff --git a/tests/python_test/utils.py b/tests/python_test/utils.py index 95d414ac80dc16247a3a35e9533f60eb7418f9f9..0d8e1e2c75cddcc604e571c5ef11d7cf4b6dd6bc 100644 --- a/tests/python_test/utils.py +++ b/tests/python_test/utils.py @@ -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