diff --git a/scripts/ci/extends/template-build-linux.yml b/scripts/ci/extends/template-build-linux.yml
index 4f833282e5fe11ccd4df6570bfdbe220e1816f34..8b12eaa4a5e29f7321ae72f07e0a68a9144f8d4e 100644
--- a/scripts/ci/extends/template-build-linux.yml
+++ b/scripts/ci/extends/template-build-linux.yml
@@ -51,7 +51,7 @@
         if [ "$BUILD_CTEST" = true ]; then
           ctest_timeout=60
           preset_postfix=""
-          if [[ "$CI_MERGE_REQUEST_LABELS" =~ .*ci_large.* ]]; then
+          if [[ "$CI_MERGE_REQUEST_LABELS" =~ .*ci_large.* && "$CI_JOB_NAME" =~ build.[linux|mac].* && ! "$CI_JOB_NAME" =~ .*sanitizer ]]; then
             export BUILD_CTEST_LARGE=true
           fi
           if [ "$BUILD_CTEST_LARGE" = true ]; then