Skip to content

Commit 36d60df

Browse files
authored
Merge pull request #5830 from jrose-apple/lit-timeout
[test] Time out individual lit tests after 20 minutes.
2 parents 7c81173 + 06843ea commit 36d60df

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,15 @@ if(PYTHONINTERP_FOUND)
252252
"--param" "test_sdk_overlay_dir=${SWIFTLIB_DIR}/${SWIFT_SDK_${SDK}_LIB_SUBDIR}")
253253
endif()
254254

255+
execute_process(COMMAND
256+
"${PYTHON_EXECUTABLE}" "-c" "import psutil"
257+
RESULT_VARIABLE python_psutil_status
258+
TIMEOUT 1 # second
259+
ERROR_QUIET)
260+
if(NOT python_psutil_status)
261+
list(APPEND LIT_ARGS "--timeout=1200") # 20 minutes
262+
endif()
263+
255264
list(APPEND LIT_ARGS "--xunit-xml-output=${SWIFT_TEST_RESULTS_DIR}/lit-tests.xml")
256265

257266
foreach(test_subset ${TEST_SUBSETS})

0 commit comments

Comments
 (0)