enhance: enable asan for e2e (#37149)

issue: #35854

---------

Signed-off-by: chyezh <chyezh@outlook.com>
pull/37245/head
Zhen Ye 2024-10-29 14:14:24 +08:00 committed by GitHub
parent 3106384fc4
commit 889434691c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 32 deletions

View File

@ -43,7 +43,7 @@ pipeline {
gitBaseRef: gitBaseRef, gitBaseRef: gitBaseRef,
pullRequestNumber: "$env.CHANGE_ID", pullRequestNumber: "$env.CHANGE_ID",
suppress_suffix_of_image_tag: true, suppress_suffix_of_image_tag: true,
make_cmd: "make clean && make install use_disk_index=ON", make_cmd: "make clean && make install USE_ASAN=ON use_disk_index=ON",
images: '["milvus","pytest","helm"]' images: '["milvus","pytest","helm"]'
milvus_image_tag = tekton.query_result job_name, 'milvus-image-tag' milvus_image_tag = tekton.query_result job_name, 'milvus-image-tag'

View File

@ -4520,6 +4520,9 @@ class TestQueryTextMatch(TestcaseBase):
if i + batch_size < len(df) if i + batch_size < len(df)
else data[i : len(df)] else data[i : len(df)]
) )
# only if the collection is flushed, the inverted index ca be applied.
# growing segment may be not applied, although in strong consistency.
collection_w.flush()
collection_w.create_index( collection_w.create_index(
"emb", "emb",
{"index_type": "IVF_SQ8", "metric_type": "L2", "params": {"nlist": 64}}, {"index_type": "IVF_SQ8", "metric_type": "L2", "params": {"nlist": 64}},
@ -5172,6 +5175,9 @@ class TestQueryTextMatch(TestcaseBase):
if i + batch_size < data_size if i + batch_size < data_size
else data[i:data_size] else data[i:data_size]
) )
# only if the collection is flushed, the inverted index ca be applied.
# growing segment may be not applied, although in strong consistency.
collection_w.flush()
collection_w.create_index( collection_w.create_index(
"emb", "emb",
{"index_type": "IVF_SQ8", "metric_type": "L2", "params": {"nlist": 64}}, {"index_type": "IVF_SQ8", "metric_type": "L2", "params": {"nlist": 64}},

View File

@ -18,11 +18,11 @@
SOURCE="${BASH_SOURCE[0]}" SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
SOURCE="$(readlink "$SOURCE")" SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done done
ROOT="$( cd -P "$( dirname "$SOURCE" )/../.." && pwd )" ROOT="$(cd -P "$(dirname "$SOURCE")/../.." && pwd)"
# Exit immediately for non zero status # Exit immediately for non zero status
set -e set -e
@ -31,8 +31,6 @@ set -u
# Print commands # Print commands
set -x set -x
MILVUS_HELM_RELEASE_NAME="${MILVUS_HELM_RELEASE_NAME:-milvus-testing}" MILVUS_HELM_RELEASE_NAME="${MILVUS_HELM_RELEASE_NAME:-milvus-testing}"
MILVUS_CLUSTER_ENABLED="${MILVUS_CLUSTER_ENABLED:-false}" MILVUS_CLUSTER_ENABLED="${MILVUS_CLUSTER_ENABLED:-false}"
MILVUS_HELM_NAMESPACE="${MILVUS_HELM_NAMESPACE:-default}" MILVUS_HELM_NAMESPACE="${MILVUS_HELM_NAMESPACE:-default}"
@ -44,11 +42,9 @@ MILVUS_SERVICE_PORT="19530"
# Minio service name # Minio service name
MINIO_SERVICE_NAME=$(echo "${MILVUS_HELM_RELEASE_NAME}-minio.${MILVUS_HELM_NAMESPACE}" | tr -d '\n') MINIO_SERVICE_NAME=$(echo "${MILVUS_HELM_RELEASE_NAME}-minio.${MILVUS_HELM_NAMESPACE}" | tr -d '\n')
# Shellcheck source=ci-util.sh # Shellcheck source=ci-util.sh
source "${ROOT}/tests/scripts/ci-util-4am.sh" source "${ROOT}/tests/scripts/ci-util-4am.sh"
cd ${ROOT}/tests/python_client cd ${ROOT}/tests/python_client
# Print python3 version, python version 3.6.8 is more stable for test # Print python3 version, python version 3.6.8 is more stable for test
@ -69,35 +65,29 @@ if [ "${DISABLE_PIP_INSTALL:-}" = "false" ]; then
install_pytest_requirements install_pytest_requirements
fi fi
cd ${ROOT}/tests/python_client cd ${ROOT}/tests/python_client
# Run bulk insert test # Run bulk insert test
# if MILVUS_HELM_RELEASE_NAME contains "msop", then it is one pod mode, skip the bulk insert test # if MILVUS_HELM_RELEASE_NAME contains "msop", then it is one pod mode, skip the bulk insert test
if [[ "${MILVUS_HELM_RELEASE_NAME}" != *"msop"* ]]; then if [[ "${MILVUS_HELM_RELEASE_NAME}" != *"msop"* ]]; then
if [[ -n "${TEST_TIMEOUT:-}" ]]; then if [[ -n "${TEST_TIMEOUT:-}" ]]; then
timeout "${TEST_TIMEOUT}" pytest testcases/test_bulk_insert.py --timeout=300 -v -x -n 6 --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} \ timeout "${TEST_TIMEOUT}" pytest testcases/test_bulk_insert.py --timeout=300 -v -x -n 6 --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} \
--html=${CI_LOG_PATH}/report_bulk_insert.html --self-contained-html --html=${CI_LOG_PATH}/report_bulk_insert.html --self-contained-html
else else
pytest testcases/test_bulk_insert.py --timeout=300 -v -x -n 6 --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} \ pytest testcases/test_bulk_insert.py --timeout=300 -v -x -n 6 --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} \
--html=${CI_LOG_PATH}/report_bulk_insert.html --self-contained-html --html=${CI_LOG_PATH}/report_bulk_insert.html --self-contained-html
fi fi
fi fi
# Run restful test v1 # Run restful test v1
cd ${ROOT}/tests/restful_client cd ${ROOT}/tests/restful_client
if [[ -n "${TEST_TIMEOUT:-}" ]]; then if [[ -n "${TEST_TIMEOUT:-}" ]]; then
timeout "${TEST_TIMEOUT}" pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} -v -x -m L0 -n 6 --timeout 180\ timeout "${TEST_TIMEOUT}" pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} -v -x -m L0 -n 6 --timeout 180 --html=${CI_LOG_PATH}/report_restful.html --self-contained-html
--html=${CI_LOG_PATH}/report_restful.html --self-contained-html
else else
pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} -v -x -m L0 -n 6 --timeout 180\ pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} -v -x -m L0 -n 6 --timeout 180 --html=${CI_LOG_PATH}/report_restful.html --self-contained-html
--html=${CI_LOG_PATH}/report_restful.html --self-contained-html
fi fi
# Run restful test v2 # Run restful test v2
@ -105,37 +95,30 @@ cd ${ROOT}/tests/restful_client_v2
if [[ -n "${TEST_TIMEOUT:-}" ]]; then if [[ -n "${TEST_TIMEOUT:-}" ]]; then
timeout "${TEST_TIMEOUT}" pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} -v -x -m L0 -n 6 --timeout 240\ timeout "${TEST_TIMEOUT}" pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} -v -x -m L0 -n 6 --timeout 360 --html=${CI_LOG_PATH}/report_restful.html --self-contained-html
--html=${CI_LOG_PATH}/report_restful.html --self-contained-html
else else
pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} -v -x -m L0 -n 6 --timeout 240\ pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} -v -x -m L0 -n 6 --timeout 360 --html=${CI_LOG_PATH}/report_restful.html --self-contained-html
--html=${CI_LOG_PATH}/report_restful.html --self-contained-html
fi fi
if [[ "${MILVUS_HELM_RELEASE_NAME}" != *"msop"* ]]; then if [[ "${MILVUS_HELM_RELEASE_NAME}" != *"msop"* ]]; then
if [[ -n "${TEST_TIMEOUT:-}" ]]; then if [[ -n "${TEST_TIMEOUT:-}" ]]; then
timeout "${TEST_TIMEOUT}" pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} -v -x -m BulkInsert -n 6 --timeout 240\ timeout "${TEST_TIMEOUT}" pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} -v -x -m BulkInsert -n 6 --timeout 360 --html=${CI_LOG_PATH}/report_restful.html --self-contained-html
--html=${CI_LOG_PATH}/report_restful.html --self-contained-html
else else
pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} -v -x -m BulkInsert -n 6 --timeout 240\ pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} -v -x -m BulkInsert -n 6 --timeout 360 --html=${CI_LOG_PATH}/report_restful.html --self-contained-html
--html=${CI_LOG_PATH}/report_restful.html --self-contained-html
fi fi
fi fi
cd ${ROOT}/tests/python_client cd ${ROOT}/tests/python_client
# Pytest is not able to have both --timeout & --workers, so do not add --timeout or --workers in the shell script # Pytest is not able to have both --timeout & --workers, so do not add --timeout or --workers in the shell script
if [[ -n "${TEST_TIMEOUT:-}" ]]; then if [[ -n "${TEST_TIMEOUT:-}" ]]; then
timeout "${TEST_TIMEOUT}" pytest --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} \ timeout "${TEST_TIMEOUT}" pytest --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} \
--html=${CI_LOG_PATH}/report.html --self-contained-html --dist loadgroup ${@:-} --html=${CI_LOG_PATH}/report.html --self-contained-html --dist loadgroup ${@:-}
else else
pytest --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} \ pytest --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} \
--html=${CI_LOG_PATH}/report.html --self-contained-html --dist loadgroup ${@:-} --html=${CI_LOG_PATH}/report.html --self-contained-html --dist loadgroup ${@:-}
fi fi
# # Run concurrent test with 5 processes # # Run concurrent test with 5 processes