未验证 提交 5eca1fce 编写于 作者: D del-zhenwu 提交者: GitHub

fix cases: test_search_id/test_wal (#1486)

Signed-off-by: Ndel-zhenwu <zw@zilliz.com>
上级 6e3991d1
......@@ -117,11 +117,12 @@ class TestFlushBase:
status, ids = connect.insert(table_new, vectors, ids, partition_tag=tag)
assert status.OK()
status = connect.flush([table])
status = connect.flush([table_new])
assert status.OK()
result, res = connect.get_table_row_count(table)
assert res == nb
result, res = connect.get_table_row_count(table_new)
assert res == 0
assert res == nb
def test_add_flush_multiable_times(self, connect, table):
'''
......
import time
import random
import pdb
import threading
import logging
......
import time
import random
import pdb
import threading
import logging
......@@ -10,13 +9,14 @@ from utils import *
dim = 128
index_file_size = 10
table_id = "test_compact"
table_id = "test_wal"
WAL_TIMEOUT = 30
nprobe = 1
top_k = 1
epsilon = 0.0001
tag = "1970-01-01"
nb = 6000
add_interval = 1.5
class TestWalBase:
......@@ -55,10 +55,9 @@ class TestWalBase:
vectors = gen_vector(nb, dim)
status, ids = connect.add_vectors(table, vectors)
assert status.OK()
connect.flush([table])
status, res = connect.get_table_row_count(table)
assert status.OK()
logging.getLogger().info(res)
assert res == 0
status = connect.delete_by_id(table, ids)
assert status.OK()
status = connect.flush([table])
......@@ -77,11 +76,9 @@ class TestWalBase:
vector = gen_single_vector(dim)
status, ids = connect.add_vectors(table, vector)
assert status.OK()
connect.flush([table])
status = connect.delete_by_id(table, [0])
assert status.OK()
status, res = connect.get_table_row_count(table)
assert status.OK()
assert res == 0
status = connect.flush([table])
assert status.OK()
status, res = connect.get_table_row_count(table)
......@@ -98,9 +95,7 @@ class TestWalBase:
vectors = gen_vector(nb, dim)
status, ids = connect.add_vectors(table, vectors)
assert status.OK()
status, res = connect.get_table_row_count(table)
assert status.OK()
assert res == 0
connect.flush([table])
table_new = gen_unique_str()
status = connect.delete_by_id(table_new, ids)
assert not status.OK()
......@@ -120,12 +115,13 @@ class TestWalBase:
vector = gen_single_vector(dim)
status, ids = connect.add_vectors(table, vector)
assert status.OK()
connect.flush([table])
status, res = connect.get_table_row_count(table)
assert status.OK()
logging.getLogger().info(res) # should be 0 because no auto flush
logging.getLogger().info("Stop server and restart")
# kill server and restart. auto flush should be set to 15 seconds.
time.sleep(15)
# time.sleep(15)
status = connect.flush([table])
assert status.OK()
status, res = connect.get_table_row_count(table)
......@@ -134,4 +130,4 @@ class TestWalBase:
status, res = connect.get_vector_by_id(table, ids[0])
logging.getLogger().info(res)
assert status.OK()
assert_equal_vector(res, vector[0])
\ No newline at end of file
assert_equal_vector(res, vector[0])
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册