Code Duplication    Length = 27-28 lines in 2 locations

tests/milvus_python_test/collection/test_collection.py 2 locations

@@ 771-798 (lines=28) @@
768
        assert len(result) == 0
769
770
    # TODO: enable
771
    @pytest.mark.level(2)
772
    def _test_list_collections_multiprocessing(self, connect, args):
773
        '''
774
        target: test show collections is correct or not with processes
775
        method: create collection, assert the value returned by list_collections method is equal to 0
776
        expected: collection_name in show collections
777
        '''
778
        collection_name = gen_unique_str("test_collection")
779
        param = {'collection_name': collection_name,
780
                 'dimension': dim,
781
                 'index_file_size': index_file_size,
782
                 'metric_type': MetricType.L2}
783
        connect.create_collection(param)
784
        def showcollections(milvus):
785
            status, result = milvus.list_collections()
786
            assert status.OK()
787
            assert collection_name in result
788
789
        process_num = 8
790
        processes = []
791
792
        for i in range(process_num):
793
            milvus = get_milvus(args["ip"], args["port"], handler=args["handler"])
794
            p = Process(target=showcollections, args=(milvus,))
795
            processes.append(p)
796
            p.start()
797
        for p in processes:
798
            p.join()
799
800
    """
801
    ******************************************************************
@@ 343-369 (lines=27) @@
340
        assert res.metric_type == MetricType.SUPERSTRUCTURE
341
342
    # TODO: enable
343
    @pytest.mark.level(2)
344
    def _test_collection_get_collection_info_name_multiprocessing(self, connect, args):
345
        '''
346
        target: test describe collection created with multiprocess 
347
        method: create collection, assert the value returned by describe method
348
        expected: collection_name equals with the collection name created
349
        '''
350
        collection_name = gen_unique_str("test_collection")
351
        param = {'collection_name': collection_name,
352
                 'dimension': dim,
353
                 'index_file_size': index_file_size, 
354
                 'metric_type': MetricType.L2}
355
        connect.create_collection(param)
356
357
        def describecollection(milvus):
358
            status, res = milvus.get_collection_info(collection_name)
359
            assert res.collection_name == collection_name
360
361
        process_num = 4
362
        processes = []
363
        for i in range(process_num):
364
            milvus = get_milvus(args["ip"], args["port"], handler=args["handler"])
365
            p = Process(target=describecollection, args=(milvus,))
366
            processes.append(p)
367
            p.start()
368
        for p in processes:
369
            p.join()
370
    
371
    # @pytest.mark.level(2)
372
    # def test_collection_describe_without_connection(self, collection, dis_connect):