test: fix testcases for verification after chaos (#37153)

/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
zhuwenxing 2024-10-28 10:33:29 +08:00 committed by GitHub
parent c8dd665bf6
commit cdee149191
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 6 deletions

View File

@ -50,7 +50,7 @@ class TestAllCollection(TestcaseBase):
# insert
offset = -3000
data = cf.get_column_data_by_schema(nb=ct.default_nb, schema=schema, start=offset)
data = cf.gen_row_data_by_schema(nb=ct.default_nb, schema=schema, start=offset)
t0 = time.time()
_, res = collection_w.insert(data)
tt = time.time() - t0
@ -108,7 +108,7 @@ class TestAllCollection(TestcaseBase):
collection_w.release()
# insert data
d = cf.get_column_data_by_schema(nb=ct.default_nb, schema=schema)
d = cf.gen_row_data_by_schema(nb=ct.default_nb, schema=schema)
collection_w.insert(d)
# load

View File

@ -28,7 +28,7 @@ from delayed_assert import assert_expectations
def get_all_collections():
try:
with open("/tmp/ci_logs/all_collections.json", "r") as f:
with open("/tmp/ci_logs/chaos_test_all_collections.json", "r") as f:
data = json.load(f)
all_collections = data["all"]
except Exception as e:

View File

@ -1664,7 +1664,7 @@ def get_column_data_by_schema(nb=ct.default_nb, schema=None, skip_vectors=False,
return data
def gen_row_data_by_schema(nb=ct.default_nb, schema=None):
def gen_row_data_by_schema(nb=ct.default_nb, schema=None, start=None):
if schema is None:
schema = gen_default_collection_schema()
# ignore auto id field and the fields in function output
@ -1688,6 +1688,9 @@ def gen_row_data_by_schema(nb=ct.default_nb, schema=None):
tmp = {}
for field in fields_needs_data:
tmp[field.name] = gen_data_by_collection_field(field)
if start is not None and field.dtype == DataType.INT64:
tmp[field.name] = start
start += 1
data.append(tmp)
return data

View File

@ -27,8 +27,8 @@ pytest-parallel
pytest-random-order
# pymilvus
pymilvus==2.5.0rc103
pymilvus[bulk_writer]==2.5.0rc103
pymilvus==2.5.0rc104
pymilvus[bulk_writer]==2.5.0rc104
# for customize config test
python-benedict==0.24.3