diff options
author | Brad King <brad.king@kitware.com> | 2022-02-04 12:15:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-02-04 12:15:40 (GMT) |
commit | 8809183d58c6ffbe9b9479ac43f44c985a4b8a5b (patch) | |
tree | 8caf813e5bbee525f8deea6620504fb48c527232 | |
parent | 32afcf74afc08e4255d4c497929653d197802adc (diff) | |
download | CMake-8809183d58c6ffbe9b9479ac43f44c985a4b8a5b.zip CMake-8809183d58c6ffbe9b9479ac43f44c985a4b8a5b.tar.gz CMake-8809183d58c6ffbe9b9479ac43f44c985a4b8a5b.tar.bz2 |
Tests: Optionally extend RunCMake.ExternalProject download server timeout
Some of the `RunCMake.ExternalProject` test cases use a download server
implemented in Python. Normally we wait up to 30 seconds for it to
start. However, on some machines running many tests concurrently, the
download server may take longer than that to start. Add an undocumented
cache entry to use on those machines to extend the timeout.
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/ExternalProject/RunCMakeTest.cmake | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 1d7e632..ddc00f8 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -733,6 +733,9 @@ add_RunCMake_test(CPackInstallProperties) if(XCODE_VERSION) set(ExternalProject_ARGS -DXCODE_VERSION=${XCODE_VERSION}) endif() +if(CMake_TEST_RunCMake_ExternalProject_DOWNLOAD_SERVER_TIMEOUT) + list(APPEND ExternalProject_ARGS -DDOWNLOAD_SERVER_TIMEOUT=${CMake_TEST_RunCMake_ExternalProject_DOWNLOAD_SERVER_TIMEOUT}) +endif() add_RunCMake_test(ExternalProject) add_RunCMake_test(FetchContent) set(CTestCommandLine_ARGS -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}) diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake index fde384f..08adee2 100644 --- a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake @@ -105,12 +105,15 @@ function(__ep_test_with_build_with_server testName) if(EXISTS "${URL_FILE}") file(REMOVE "${URL_FILE}") endif() + if(NOT DOWNLOAD_SERVER_TIMEOUT) + set(DOWNLOAD_SERVER_TIMEOUT 30) + endif() execute_process( COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/DownloadServer.py --file "${URL_FILE}" ${ARGN} OUTPUT_FILE ${RunCMake_BINARY_DIR}/${testName}-python.txt ERROR_FILE ${RunCMake_BINARY_DIR}/${testName}-python.txt RESULT_VARIABLE result - TIMEOUT 30 + TIMEOUT "${DOWNLOAD_SERVER_TIMEOUT}" ) if(NOT result EQUAL 0) message(FATAL_ERROR "Failed to start download server:\n ${result}") |