Unverified Commit 18a9b9ce authored by Jin Hai's avatar Jin Hai Committed by GitHub
Browse files

Merge pull request #623 from del-zhenwu/0.6.0

Update build index timeout
parents 91b165d3 e4c7115b
Loading
Loading
Loading
Loading
+19 −19
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ index_file_size = 10
vectors = gen_vectors(nb, dim)
vectors = sklearn.preprocessing.normalize(vectors, axis=1, norm='l2')
vectors = vectors.tolist()
BUILD_TIMEOUT = 60
BUILD_TIMEOUT = 300
nprobe = 1
tag = "1970-01-01"

@@ -51,27 +51,27 @@ class TestIndexBase:
    """

    @pytest.mark.timeout(BUILD_TIMEOUT)
    def test_create_index(self, connect, table, get_index_params):
    def test_create_index(self, connect, table, get_simple_index_params):
        '''
        target: test create index interface
        method: create table and add vectors in it, create index
        expected: return code equals to 0, and search success
        '''
        index_params = get_index_params
        index_params = get_simple_index_params
        logging.getLogger().info(index_params)
        status, ids = connect.add_vectors(table, vectors)
        status = connect.create_index(table, index_params)
        assert status.OK()

    @pytest.mark.timeout(BUILD_TIMEOUT)
    def test_create_index_partition(self, connect, table, get_index_params):
    def test_create_index_partition(self, connect, table, get_simple_index_params):
        '''
        target: test create index interface
        method: create table, create partition, and add vectors in it, create index
        expected: return code equals to 0, and search success
        '''
        partition_name = gen_unique_str()
        index_params = get_index_params
        index_params = get_simple_index_params
        logging.getLogger().info(index_params)
        status = connect.create_partition(table, partition_name, tag)
        status, ids = connect.add_vectors(table, vectors, partition_tag=tag)
@@ -91,13 +91,13 @@ class TestIndexBase:
            status = dis_connect.create_index(table, index_param)

    @pytest.mark.timeout(BUILD_TIMEOUT)
    def test_create_index_search_with_query_vectors(self, connect, table, get_index_params):
    def test_create_index_search_with_query_vectors(self, connect, table, get_simple_index_params):
        '''
        target: test create index interface, search with more query vectors
        method: create table and add vectors in it, create index
        expected: return code equals to 0, and search success
        '''
        index_params = get_index_params
        index_params = get_simple_index_params
        logging.getLogger().info(index_params)
        status, ids = connect.add_vectors(table, vectors)
        status = connect.create_index(table, index_params)
@@ -291,13 +291,13 @@ class TestIndexBase:
    ******************************************************************
    """

    def test_describe_index(self, connect, table, get_index_params):
    def test_describe_index(self, connect, table, get_simple_index_params):
        '''
        target: test describe index interface
        method: create table and add vectors in it, create index, call describe index
        expected: return code 0, and index instructure
        '''
        index_params = get_index_params
        index_params = get_simple_index_params
        logging.getLogger().info(index_params)
        status, ids = connect.add_vectors(table, vectors)
        status = connect.create_index(table, index_params)
@@ -398,13 +398,13 @@ class TestIndexBase:
    ******************************************************************
    """

    def test_drop_index(self, connect, table, get_index_params):
    def test_drop_index(self, connect, table, get_simple_index_params):
        '''
        target: test drop index interface
        method: create table and add vectors in it, create index, call drop index
        expected: return code 0, and default index param
        '''
        index_param = get_index_params
        index_param = get_simple_index_params
        status, ids = connect.add_vectors(table, vectors)
        status = connect.create_index(table, index_param)
        assert status.OK()
@@ -418,13 +418,13 @@ class TestIndexBase:
        assert result._table_name == table
        assert result._index_type == IndexType.FLAT

    def test_drop_index_repeatly(self, connect, table, get_index_params):
    def test_drop_index_repeatly(self, connect, table, get_simple_index_params):
        '''
        target: test drop index repeatly
        method: create index, call drop index, and drop again
        expected: return code 0
        '''
        index_param = get_index_params
        index_param = get_simple_index_params
        status, ids = connect.add_vectors(table, vectors)
        status = connect.create_index(table, index_param)
        assert status.OK()
@@ -560,13 +560,13 @@ class TestIndexIP:
    """
    @pytest.mark.level(2)
    @pytest.mark.timeout(BUILD_TIMEOUT)
    def test_create_index(self, connect, ip_table, get_index_params):
    def test_create_index(self, connect, ip_table, get_simple_index_params):
        '''
        target: test create index interface
        method: create table and add vectors in it, create index
        expected: return code equals to 0, and search success
        '''
        index_params = get_index_params
        index_params = get_simple_index_params
        logging.getLogger().info(index_params)
        status, ids = connect.add_vectors(ip_table, vectors)
        status = connect.create_index(ip_table, index_params)
@@ -576,14 +576,14 @@ class TestIndexIP:
            assert status.OK()

    @pytest.mark.timeout(BUILD_TIMEOUT)
    def test_create_index_partition(self, connect, ip_table, get_index_params):
    def test_create_index_partition(self, connect, ip_table, get_simple_index_params):
        '''
        target: test create index interface
        method: create table, create partition, and add vectors in it, create index
        expected: return code equals to 0, and search success
        '''
        partition_name = gen_unique_str()
        index_params = get_index_params
        index_params = get_simple_index_params
        logging.getLogger().info(index_params)
        status = connect.create_partition(ip_table, partition_name, tag)
        status, ids = connect.add_vectors(ip_table, vectors, partition_tag=tag)
@@ -606,13 +606,13 @@ class TestIndexIP:
            status = dis_connect.create_index(ip_table, index_param)

    @pytest.mark.timeout(BUILD_TIMEOUT)
    def test_create_index_search_with_query_vectors(self, connect, ip_table, get_index_params):
    def test_create_index_search_with_query_vectors(self, connect, ip_table, get_simple_index_params):
        '''
        target: test create index interface, search with more query vectors
        method: create table and add vectors in it, create index
        expected: return code equals to 0, and search success
        '''
        index_params = get_index_params
        index_params = get_simple_index_params
        logging.getLogger().info(index_params)
        status, ids = connect.add_vectors(ip_table, vectors)
        status = connect.create_index(ip_table, index_params)
+2 −1
Original line number Diff line number Diff line
@@ -327,8 +327,9 @@ class TestTableCountIP:
        status, res = connect.get_table_row_count(ip_table)
        assert res == 0

    # TODO: enable
    @pytest.mark.timeout(60)
    def test_table_rows_count_multiprocessing(self, connect, ip_table, args):
    def _test_table_rows_count_multiprocessing(self, connect, ip_table, args):
        '''
        target: test table rows_count is correct or not with multiprocess
        method: create table and add vectors in it,