Skip to content

Commit

Permalink
enhance: enable asan for e2e (milvus-io#37149)
Browse files Browse the repository at this point in the history
issue: milvus-io#35854

---------

Signed-off-by: chyezh <[email protected]>
  • Loading branch information
chyezh authored Oct 29, 2024
1 parent 3106384 commit 8894346
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 32 deletions.
2 changes: 1 addition & 1 deletion ci/jenkins/PR.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pipeline {
gitBaseRef: gitBaseRef,
pullRequestNumber: "$env.CHANGE_ID",
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"]'

milvus_image_tag = tekton.query_result job_name, 'milvus-image-tag'
Expand Down
6 changes: 6 additions & 0 deletions tests/python_client/testcases/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -4520,6 +4520,9 @@ def test_query_text_match_normal(
if i + batch_size < 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(
"emb",
{"index_type": "IVF_SQ8", "metric_type": "L2", "params": {"nlist": 64}},
Expand Down Expand Up @@ -5172,6 +5175,9 @@ def test_query_text_match_with_addition_inverted_index(self):
if i + batch_size < 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(
"emb",
{"index_type": "IVF_SQ8", "metric_type": "L2", "params": {"nlist": 64}},
Expand Down
45 changes: 14 additions & 31 deletions tests/scripts/ci_e2e_4am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

SOURCE="${BASH_SOURCE[0]}"
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 != /* ]] && 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
ROOT="$( cd -P "$( dirname "$SOURCE" )/../.." && pwd )"
ROOT="$(cd -P "$(dirname "$SOURCE")/../.." && pwd)"

# Exit immediately for non zero status
set -e
Expand All @@ -31,8 +31,6 @@ set -u
# Print commands
set -x



MILVUS_HELM_RELEASE_NAME="${MILVUS_HELM_RELEASE_NAME:-milvus-testing}"
MILVUS_CLUSTER_ENABLED="${MILVUS_CLUSTER_ENABLED:-false}"
MILVUS_HELM_NAMESPACE="${MILVUS_HELM_NAMESPACE:-default}"
Expand All @@ -44,11 +42,9 @@ MILVUS_SERVICE_PORT="19530"
# Minio service name
MINIO_SERVICE_NAME=$(echo "${MILVUS_HELM_RELEASE_NAME}-minio.${MILVUS_HELM_NAMESPACE}" | tr -d '\n')


# Shellcheck source=ci-util.sh
source "${ROOT}/tests/scripts/ci-util-4am.sh"


cd ${ROOT}/tests/python_client

# Print python3 version, python version 3.6.8 is more stable for test
Expand All @@ -69,73 +65,60 @@ if [ "${DISABLE_PIP_INSTALL:-}" = "false" ]; then
install_pytest_requirements
fi




cd ${ROOT}/tests/python_client
# 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}" != *"msop"* ]]; 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} \
--html=${CI_LOG_PATH}/report_bulk_insert.html --self-contained-html
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
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} \
--html=${CI_LOG_PATH}/report_bulk_insert.html --self-contained-html
--html=${CI_LOG_PATH}/report_bulk_insert.html --self-contained-html
fi
fi


# Run restful test v1

cd ${ROOT}/tests/restful_client

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\
--html=${CI_LOG_PATH}/report_restful.html --self-contained-html
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
else
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
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
fi

# Run restful test v2
cd ${ROOT}/tests/restful_client_v2

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\
--html=${CI_LOG_PATH}/report_restful.html --self-contained-html
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
else
pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} -v -x -m L0 -n 6 --timeout 240\
--html=${CI_LOG_PATH}/report_restful.html --self-contained-html
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
fi


if [[ "${MILVUS_HELM_RELEASE_NAME}" != *"msop"* ]]; 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\
--html=${CI_LOG_PATH}/report_restful.html --self-contained-html
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
else
pytest testcases --endpoint http://${MILVUS_SERVICE_NAME}:${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} -v -x -m BulkInsert -n 6 --timeout 240\
--html=${CI_LOG_PATH}/report_restful.html --self-contained-html
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
fi
fi


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
if [[ -n "${TEST_TIMEOUT:-}" ]]; then

timeout "${TEST_TIMEOUT}" pytest --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} \
--html=${CI_LOG_PATH}/report.html --self-contained-html --dist loadgroup ${@:-}
timeout "${TEST_TIMEOUT}" pytest --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} \
--html=${CI_LOG_PATH}/report.html --self-contained-html --dist loadgroup ${@:-}
else
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

# # Run concurrent test with 5 processes
Expand Down

0 comments on commit 8894346

Please sign in to comment.