Skip to content

Commit aa0b94c

Browse files
authored
Address task timeouts on VS 2015 distros due to KMS KMIP mock server (#1198)
* Use ccache if available via C Driver's find-ccache.sh * Add --max-time to curl command waiting on KMS servers * Remove CXX-2628 workaround * CXX-2628 Skip CSFLE setup on windows-64-2015-* distros
1 parent 8c23807 commit aa0b94c

File tree

5 files changed

+33
-57
lines changed

5 files changed

+33
-57
lines changed

.evergreen/abi-stability-setup.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ declare cmake_binary
2626
cmake_binary="$(find_cmake_latest)"
2727
command -V "${cmake_binary:?}"
2828

29+
# Use ccache if available.
30+
if [[ -f "./mongoc/.evergreen/scripts/find-ccache.sh" ]]; then
31+
# shellcheck source=/dev/null
32+
. "./mongoc/.evergreen/scripts/find-ccache.sh"
33+
find_ccache_and_export_vars "$(pwd)" || true
34+
fi
35+
2936
# To use a different base commit, replace `--abbrev 0` with the intended commit.
3037
# Note: EVG treat all changes relative to the EVG base commit as staged changes!
3138
declare base current
@@ -55,17 +62,6 @@ else
5562
CMAKE_BUILD_PARALLEL_LEVEL="${parallel_level:?}"
5663
fi
5764

58-
# Use ccache if available.
59-
if command -V ccache 2>/dev/null; then
60-
export CMAKE_C_COMPILER_LAUNCHER=ccache
61-
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
62-
63-
# Allow reuse of ccache compilation results between different build directories.
64-
export CCACHE_BASEDIR CCACHE_NOHASHDIR
65-
CCACHE_BASEDIR="$(pwd)/mongo-cxx-driver"
66-
CCACHE_NOHASHDIR=1
67-
fi
68-
6965
# Install prefix to use for ABI compatibility scripts.
7066
mkdir -p "${working_dir}/install"
7167

.evergreen/compile.sh

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,10 @@ CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)"
6666
export CMAKE_BUILD_PARALLEL_LEVEL
6767

6868
# Use ccache if available.
69-
if command -V ccache 2>/dev/null; then
70-
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
71-
72-
# Allow reuse of ccache compilation results between different build directories.
73-
export CCACHE_BASEDIR CCACHE_NOHASHDIR
74-
if [[ "${OSTYPE:?}" == "cygwin" ]]; then
75-
CCACHE_BASEDIR="$(cygpath -aw "$(pwd)")"
76-
else
77-
CCACHE_BASEDIR="$(pwd)"
78-
fi
79-
CCACHE_NOHASHDIR=1
69+
if [[ -f "${mongoc_prefix:?}/.evergreen/scripts/find-ccache.sh" ]]; then
70+
# shellcheck source=/dev/null
71+
. "${mongoc_prefix:?}/.evergreen/scripts/find-ccache.sh"
72+
find_ccache_and_export_vars "$(pwd)" || true
8073
fi
8174

8275
cmake_build_opts=()

.evergreen/install_c_driver.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,10 @@ else
131131
fi
132132

133133
# Use ccache if available.
134-
if command -V ccache 2>/dev/null; then
135-
export CMAKE_C_COMPILER_LAUNCHER=ccache
136-
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
137-
138-
# Allow reuse of ccache compilation results between different build directories.
139-
export CCACHE_BASEDIR CCACHE_NOHASHDIR
140-
CCACHE_BASEDIR="${mongoc_idir}"
141-
CCACHE_NOHASHDIR=1
134+
if [[ -f "${mongoc_dir:?}/.evergreen/scripts/find-ccache.sh" ]]; then
135+
# shellcheck source=/dev/null
136+
. "${mongoc_dir:?}/.evergreen/scripts/find-ccache.sh"
137+
find_ccache_and_export_vars "$(pwd)" || true
142138
fi
143139

144140
# Install libmongoc.

.evergreen/test.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ export MONGOCXX_TEST_TLS_CA_FILE="${DRIVERS_TOOLS:?}/.evergreen/x509gen/ca.pem"
106106

107107
if [ "$(uname -m)" == "ppc64le" ]; then
108108
echo "Skipping CSFLE test setup (CDRIVER-4246/CXX-2423)"
109+
elif [[ "${distro_id:?}" =~ windows-64-vs2015-* ]]; then
110+
# Python: ImportError: DLL load failed while importing _rust: The specified procedure could not be found.
111+
echo "Skipping CSFLE test setup (CXX-2628)"
109112
else
110113
# export environment variables for encryption tests
111114
set +o errexit
@@ -202,7 +205,7 @@ else
202205
for _ in $(seq 60); do
203206
# Exit code 7: "Failed to connect to host".
204207
if
205-
curl -s "localhost:${port:?}"
208+
curl -s -m 1 "localhost:${port:?}"
206209
(($? != 7))
207210
then
208211
return 0

.mci.yml

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ functions:
215215
wait_for_mongohouse() {
216216
for _ in $(seq 300); do
217217
# Exit code 7: "Failed to connect to host".
218-
if curl -s localhost:$1; (("$?" != 7)); then
218+
if curl -s -m 1 localhost:$1; (("$?" != 7)); then
219219
return 0
220220
else
221221
sleep 1
@@ -419,23 +419,17 @@ functions:
419419
script: |-
420420
set -o errexit
421421
echo "Preparing CSFLE venv environment..."
422+
if [[ "${distro_id}" =~ windows-64-vs2015-* ]]; then
423+
# Python: ImportError: DLL load failed while importing _rust: The specified procedure could not be found.
424+
echo "Preparing CSFLE venv environment... skipped."
425+
exit 0
426+
fi
422427
cd ./drivers-evergreen-tools/.evergreen/csfle
423428
# This function ensures future invocations of activate-kmstlsvenv.sh conducted in
424429
# parallel do not race to setup a venv environment; it has already been prepared.
425430
# This primarily addresses the situation where the "test" and "run_kms_servers"
426431
# functions invoke 'activate-kmstlsvenv.sh' simultaneously.
427-
if [[ "$OSTYPE" =~ cygwin && ! -d kmstlsvenv ]]; then
428-
# Avoid using Python 3.10 on Windows due to incompatible cipher suites.
429-
# See CXX-2628.
430-
. ../venv-utils.sh
431-
venvcreate "C:/python/Python39/python.exe" kmstlsvenv || # windows-2017
432-
venvcreate "C:/python/Python38/python.exe" kmstlsvenv # windows-2015
433-
python -m pip install --upgrade boto3~=1.19 pykmip~=0.10.0 "sqlalchemy<2.0.0"
434-
deactivate
435-
else
436-
. ./activate-kmstlsvenv.sh
437-
deactivate
438-
fi
432+
. ./activate-kmstlsvenv.sh && deactivate
439433
echo "Preparing CSFLE venv environment... done."
440434
- command: shell.exec
441435
params:
@@ -444,6 +438,11 @@ functions:
444438
script: |-
445439
set -o errexit
446440
echo "Starting mock KMS servers..."
441+
if [[ "${distro_id}" =~ windows-64-vs2015-* ]]; then
442+
# Python: ImportError: DLL load failed while importing _rust: The specified procedure could not be found.
443+
echo "Starting mock KMS servers... skipped."
444+
exit 0
445+
fi
447446
cd ./drivers-evergreen-tools/.evergreen/csfle
448447
. ./activate-kmstlsvenv.sh
449448
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8999 &
@@ -1044,19 +1043,8 @@ tasks:
10441043
export cmake_binary
10451044
cmake_binary="$(find_cmake_latest)"
10461045
# Use ccache if available.
1047-
if command -V ccache 2>/dev/null; then
1048-
export CMAKE_C_COMPILER_LAUNCHER=ccache
1049-
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
1050-
1051-
# Allow reuse of ccache compilation results between different build directories.
1052-
export CCACHE_BASEDIR CCACHE_NOHASHDIR
1053-
if [[ "${OSTYPE:?}" == "cygwin" ]]; then
1054-
CCACHE_BASEDIR="$(cygpath -aw "$(pwd)")"
1055-
else
1056-
CCACHE_BASEDIR="$(pwd)"
1057-
fi
1058-
CCACHE_NOHASHDIR=1
1059-
fi
1046+
. ./mongo-c-driver/.evergreen/scripts/find-ccache.sh
1047+
find_ccache_and_export_vars "$(pwd)" || true
10601048
command -v "$cmake_binary"
10611049
"$cmake_binary" -S . -B build -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF
10621050
"$cmake_binary" --build build

0 commit comments

Comments
 (0)