Skip to content

Commit 6b52998

Browse files
thomashampsonpeterfpeterson
authored andcommitted
Enable use of a unit test thread limit in Jenkins. (mantidproject#39481)
Add a check for a new `UNIT_TEST_THREADS` environment variable that can be set in the Jenkins configuration for each node that can be used to limit the number of unit tests to be run in parallel. This has been done so that we can limit the number of unit tests processes on out macOS builders, some of which have limited RAM (compared to the core count). ### Further detail of work I have set `UNIT_TEST_THREADS=6` on the following nodes, which have been observed to timeout on tests: - isis-ndw2564 - isis-ndw2995 - isis-ndw2996 This value is two below the number of cores, so will hopefully give the machines more resources to run the tests in parallel successfully. We can tweak the number inside the Jenkins configuration if required.
1 parent cf08564 commit 6b52998

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

buildconfig/Jenkins/Conda/run-tests

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ if [[ -z "$BUILD_THREADS_SYSTEM_TESTS" ]]; then
2626
BUILD_THREADS_SYSTEM_TESTS=3
2727
fi
2828

29+
# Jenkins nodes may specify the maximum number of unit tests to run in parallel.
30+
# This is useful to prevent test timeouts for machines with limited RAM.
31+
if [[ -z "$UNIT_TEST_THREADS" ]]; then
32+
# Default is number of build threads.
33+
UNIT_TEST_THREADS=$BUILD_THREADS
34+
fi
35+
2936
function run_with_xvfb {
3037
if [ $(command -v xvfb-run) ]; then
3138
# Use -e because a bug on RHEL7 means --error-file produces an error: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=337703;msg=2
@@ -85,7 +92,7 @@ cd $WORKSPACE/build
8592
# mkdir for test logs
8693
mkdir -p test_logs
8794
if [[ $ENABLE_UNIT_TESTS == true ]]; then
88-
run_with_xvfb ctest -j$BUILD_THREADS --no-compress-output -T Test -O test_logs/ctest_$OSTYPE.log --schedule-random --output-on-failure --repeat until-pass:3 $WINDOWS_TEST_OPTIONS $WINDOWS_UNITTEST_TIMEOUT_OPTIONS
95+
run_with_xvfb ctest -j$UNIT_TEST_THREADS --no-compress-output -T Test -O test_logs/ctest_$OSTYPE.log --schedule-random --output-on-failure --repeat until-pass:3 $WINDOWS_TEST_OPTIONS $WINDOWS_UNITTEST_TIMEOUT_OPTIONS
8996
fi
9097

9198
if [[ $ENABLE_DOCS == true && $ENABLE_DOC_TESTS == true ]]; then

0 commit comments

Comments
 (0)