Skip to content

Address task timeouts on VS 2015 distros due to KMS KMIP mock server #1198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions .evergreen/abi-stability-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ declare cmake_binary
cmake_binary="$(find_cmake_latest)"
command -V "${cmake_binary:?}"

# Use ccache if available.
if [[ -f "./mongoc/.evergreen/scripts/find-ccache.sh" ]]; then
# shellcheck source=/dev/null
. "./mongoc/.evergreen/scripts/find-ccache.sh"
find_ccache_and_export_vars "$(pwd)" || true
fi

# To use a different base commit, replace `--abbrev 0` with the intended commit.
# Note: EVG treat all changes relative to the EVG base commit as staged changes!
declare base current
Expand Down Expand Up @@ -55,17 +62,6 @@ else
CMAKE_BUILD_PARALLEL_LEVEL="${parallel_level:?}"
fi

# Use ccache if available.
if command -V ccache 2>/dev/null; then
export CMAKE_C_COMPILER_LAUNCHER=ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache

# Allow reuse of ccache compilation results between different build directories.
export CCACHE_BASEDIR CCACHE_NOHASHDIR
CCACHE_BASEDIR="$(pwd)/mongo-cxx-driver"
CCACHE_NOHASHDIR=1
fi

# Install prefix to use for ABI compatibility scripts.
mkdir -p "${working_dir}/install"

Expand Down
15 changes: 4 additions & 11 deletions .evergreen/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,10 @@ CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)"
export CMAKE_BUILD_PARALLEL_LEVEL

# Use ccache if available.
if command -V ccache 2>/dev/null; then
export CMAKE_CXX_COMPILER_LAUNCHER=ccache

# Allow reuse of ccache compilation results between different build directories.
export CCACHE_BASEDIR CCACHE_NOHASHDIR
if [[ "${OSTYPE:?}" == "cygwin" ]]; then
CCACHE_BASEDIR="$(cygpath -aw "$(pwd)")"
else
CCACHE_BASEDIR="$(pwd)"
fi
CCACHE_NOHASHDIR=1
if [[ -f "${mongoc_prefix:?}/.evergreen/scripts/find-ccache.sh" ]]; then
# shellcheck source=/dev/null
. "${mongoc_prefix:?}/.evergreen/scripts/find-ccache.sh"
find_ccache_and_export_vars "$(pwd)" || true
fi

cmake_build_opts=()
Expand Down
12 changes: 4 additions & 8 deletions .evergreen/install_c_driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,10 @@ else
fi

# Use ccache if available.
if command -V ccache 2>/dev/null; then
export CMAKE_C_COMPILER_LAUNCHER=ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache

# Allow reuse of ccache compilation results between different build directories.
export CCACHE_BASEDIR CCACHE_NOHASHDIR
CCACHE_BASEDIR="${mongoc_idir}"
CCACHE_NOHASHDIR=1
if [[ -f "${mongoc_dir:?}/.evergreen/scripts/find-ccache.sh" ]]; then
# shellcheck source=/dev/null
. "${mongoc_dir:?}/.evergreen/scripts/find-ccache.sh"
find_ccache_and_export_vars "$(pwd)" || true
fi

# Install libmongoc.
Expand Down
5 changes: 4 additions & 1 deletion .evergreen/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ export MONGOCXX_TEST_TLS_CA_FILE="${DRIVERS_TOOLS:?}/.evergreen/x509gen/ca.pem"

if [ "$(uname -m)" == "ppc64le" ]; then
echo "Skipping CSFLE test setup (CDRIVER-4246/CXX-2423)"
elif [[ "${distro_id:?}" =~ windows-64-vs2015-* ]]; then
# Python: ImportError: DLL load failed while importing _rust: The specified procedure could not be found.
echo "Skipping CSFLE test setup (CXX-2628)"
else
# export environment variables for encryption tests
set +o errexit
Expand Down Expand Up @@ -202,7 +205,7 @@ else
for _ in $(seq 60); do
# Exit code 7: "Failed to connect to host".
if
curl -s "localhost:${port:?}"
curl -s -m 1 "localhost:${port:?}"
(($? != 7))
then
return 0
Expand Down
40 changes: 14 additions & 26 deletions .mci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ functions:
wait_for_mongohouse() {
for _ in $(seq 300); do
# Exit code 7: "Failed to connect to host".
if curl -s localhost:$1; (("$?" != 7)); then
if curl -s -m 1 localhost:$1; (("$?" != 7)); then
return 0
else
sleep 1
Expand Down Expand Up @@ -419,23 +419,17 @@ functions:
script: |-
set -o errexit
echo "Preparing CSFLE venv environment..."
if [[ "${distro_id}" =~ windows-64-vs2015-* ]]; then
# Python: ImportError: DLL load failed while importing _rust: The specified procedure could not be found.
echo "Preparing CSFLE venv environment... skipped."
exit 0
fi
cd ./drivers-evergreen-tools/.evergreen/csfle
# This function ensures future invocations of activate-kmstlsvenv.sh conducted in
# parallel do not race to setup a venv environment; it has already been prepared.
# This primarily addresses the situation where the "test" and "run_kms_servers"
# functions invoke 'activate-kmstlsvenv.sh' simultaneously.
if [[ "$OSTYPE" =~ cygwin && ! -d kmstlsvenv ]]; then
# Avoid using Python 3.10 on Windows due to incompatible cipher suites.
# See CXX-2628.
. ../venv-utils.sh
venvcreate "C:/python/Python39/python.exe" kmstlsvenv || # windows-2017
venvcreate "C:/python/Python38/python.exe" kmstlsvenv # windows-2015
python -m pip install --upgrade boto3~=1.19 pykmip~=0.10.0 "sqlalchemy<2.0.0"
deactivate
else
. ./activate-kmstlsvenv.sh
deactivate
fi
. ./activate-kmstlsvenv.sh && deactivate
echo "Preparing CSFLE venv environment... done."
- command: shell.exec
params:
Expand All @@ -444,6 +438,11 @@ functions:
script: |-
set -o errexit
echo "Starting mock KMS servers..."
if [[ "${distro_id}" =~ windows-64-vs2015-* ]]; then
# Python: ImportError: DLL load failed while importing _rust: The specified procedure could not be found.
echo "Starting mock KMS servers... skipped."
exit 0
fi
cd ./drivers-evergreen-tools/.evergreen/csfle
. ./activate-kmstlsvenv.sh
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8999 &
Expand Down Expand Up @@ -1044,19 +1043,8 @@ tasks:
export cmake_binary
cmake_binary="$(find_cmake_latest)"
# Use ccache if available.
if command -V ccache 2>/dev/null; then
export CMAKE_C_COMPILER_LAUNCHER=ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache

# Allow reuse of ccache compilation results between different build directories.
export CCACHE_BASEDIR CCACHE_NOHASHDIR
if [[ "${OSTYPE:?}" == "cygwin" ]]; then
CCACHE_BASEDIR="$(cygpath -aw "$(pwd)")"
else
CCACHE_BASEDIR="$(pwd)"
fi
CCACHE_NOHASHDIR=1
fi
. ./mongo-c-driver/.evergreen/scripts/find-ccache.sh
find_ccache_and_export_vars "$(pwd)" || true
command -v "$cmake_binary"
"$cmake_binary" -S . -B build -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF
"$cmake_binary" --build build
Expand Down