From 95c641559ded8afd94528de05543a82af28bd117 Mon Sep 17 00:00:00 2001 From: Mark Bolstad Date: Mon, 9 Jan 2023 08:42:23 -0700 Subject: [PATCH] Add cmake flag to override default ctest timeouts The current ctest timeout in VTK-m are fine for the CI, but are too long for develoment when a test is hanging on a queued node. This commit allows a developer to turn off the majority of the hard coded timeout values which allows them to set them at the ctest command-line. --- CMake/testing/VTKmTestWrappers.cmake | 52 +++++++++++++++++++--------- CMakeLists.txt | 6 ++++ 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/CMake/testing/VTKmTestWrappers.cmake b/CMake/testing/VTKmTestWrappers.cmake index 508bbd300..df20d1deb 100644 --- a/CMake/testing/VTKmTestWrappers.cmake +++ b/CMake/testing/VTKmTestWrappers.cmake @@ -298,34 +298,54 @@ vtkm_unit_tests but not in its test dependencies. Add test dependencies to \ $ ${tname} ${device_command_line_argument} ${vtkm_default_test_log_level} ${VTKm_UT_TEST_ARGS} ${MPIEXEC_POSTFLAGS} ) - set_tests_properties("${tname}${upper_backend}_mpi" PROPERTIES - LABELS "${upper_backend};${VTKm_UT_LABEL}" - TIMEOUT ${timeout} - RUN_SERIAL ${run_serial} - FAIL_REGULAR_EXPRESSION "runtime error") + if (VTKm_OVERRIDE_CTEST_TIMEOUT) + set_tests_properties("${tname}${upper_backend}_mpi" PROPERTIES + LABELS "${upper_backend};${VTKm_UT_LABEL}" + RUN_SERIAL ${run_serial} + FAIL_REGULAR_EXPRESSION "runtime error") + else() + set_tests_properties("${tname}${upper_backend}_mpi" PROPERTIES + LABELS "${upper_backend};${VTKm_UT_LABEL}" + TIMEOUT ${timeout} + RUN_SERIAL ${run_serial} + FAIL_REGULAR_EXPRESSION "runtime error") + endif() # VTKm_OVERRIDE_CTEST_TIMEOUT endif() # VTKm_ENABLE_MPI if ((NOT VTKm_ENABLE_MPI) OR VTKm_ENABLE_DIY_NOMPI) add_test(NAME ${tname}${upper_backend}_nompi COMMAND ${test_prog}_nompi ${tname} ${device_command_line_argument} ${vtkm_default_test_log_level} ${VTKm_UT_TEST_ARGS} ) - set_tests_properties("${tname}${upper_backend}_nompi" PROPERTIES - LABELS "${upper_backend};${VTKm_UT_LABEL}" - TIMEOUT ${timeout} - RUN_SERIAL ${run_serial} - FAIL_REGULAR_EXPRESSION "runtime error") - + if (VTKm_OVERRIDE_CTEST_TIMEOUT) + set_tests_properties("${tname}${upper_backend}_nompi" PROPERTIES + LABELS "${upper_backend};${VTKm_UT_LABEL}" + RUN_SERIAL ${run_serial} + FAIL_REGULAR_EXPRESSION "runtime error") + else() + set_tests_properties("${tname}${upper_backend}_nompi" PROPERTIES + LABELS "${upper_backend};${VTKm_UT_LABEL}" + TIMEOUT ${timeout} + RUN_SERIAL ${run_serial} + FAIL_REGULAR_EXPRESSION "runtime error") + endif() #VTKm_OVERRIDE_CTEST_TIMEOUT endif() # VTKm_ENABLE_DIY_NOMPI else() # VTKm_UT_MPI add_test(NAME ${tname}${upper_backend} COMMAND ${test_prog} ${tname} ${device_command_line_argument} ${vtkm_default_test_log_level} ${VTKm_UT_TEST_ARGS} ) - set_tests_properties("${tname}${upper_backend}" PROPERTIES - LABELS "${upper_backend};${VTKm_UT_LABEL}" - TIMEOUT ${timeout} - RUN_SERIAL ${run_serial} - FAIL_REGULAR_EXPRESSION "runtime error") + if (VTKm_OVERRIDE_CTEST_TIMEOUT) + set_tests_properties("${tname}${upper_backend}" PROPERTIES + LABELS "${upper_backend};${VTKm_UT_LABEL}" + RUN_SERIAL ${run_serial} + FAIL_REGULAR_EXPRESSION "runtime error") + else() + set_tests_properties("${tname}${upper_backend}" PROPERTIES + LABELS "${upper_backend};${VTKm_UT_LABEL}" + TIMEOUT ${timeout} + RUN_SERIAL ${run_serial} + FAIL_REGULAR_EXPRESSION "runtime error") + endif() #VTKm_OVERRIDE_CTEST_TIMEOUT endif() # VTKm_UT_MPI endforeach() endforeach() diff --git a/CMakeLists.txt b/CMakeLists.txt index 31572a24b..725199cc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,6 +181,11 @@ vtkm_option(VTKm_NO_INSTALL_README_LICENSE "disable the installation of README a # Allow VTK to turn off these symlinks for its wheel distribution. vtkm_option(VTKm_SKIP_LIBRARY_VERSIONS "Skip versioning VTK-m libraries" OFF) +# During development, running unit tests with the default values can be too lengthy. +# Allow for the developer to skip the majority of the default values and control them +# through ctest's command-line. Doesn't affect CI unless enabled. +vtkm_option(VTKm_OVERRIDE_CTEST_TIMEOUT "Disable default ctest timeout" OFF) + mark_as_advanced( VTKm_ENABLE_LOGGING VTKm_NO_ASSERT @@ -191,6 +196,7 @@ mark_as_advanced( VTKm_ENABLE_DEVELOPER_FLAGS VTKm_NO_INSTALL_README_LICENSE VTKm_SKIP_LIBRARY_VERSIONS + VTKm_OVERRIDE_CTEST_TIMEOUT ) #-----------------------------------------------------------------------------