From dbcf6336e889a2cf4a320b8932b9d88d5f6c9d77 Mon Sep 17 00:00:00 2001 From: Kevin Huck Date: Tue, 21 May 2024 08:42:29 -0700 Subject: [PATCH] Adding environment variables to tests Disabling the asynchronous thread for the apex_version test, there is a race condition somewhere that causes apex to crash 1% of the time for this short test that prints the apex version. I thought I have fixed it multiple times but I am tired of playing whack-a-mole for this short test. --- src/unit_tests/C++/CMakeLists.txt | 2 ++ src/unit_tests/C/CMakeLists.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/src/unit_tests/C++/CMakeLists.txt b/src/unit_tests/C++/CMakeLists.txt index 08ba719a..6b9e7e14 100644 --- a/src/unit_tests/C++/CMakeLists.txt +++ b/src/unit_tests/C++/CMakeLists.txt @@ -121,6 +121,8 @@ set_property (TEST test_apex_malloc_cpp APPEND PROPERTY ENVIRONMENT set_property (TEST test_apex_malloc_cpp APPEND PROPERTY ENVIRONMENT "APEX_TRACK_CPU_MEMORY=1") +set_tests_properties(test_apex_version_cpp PROPERTIES ENVIRONMENT "APEX_PROC_SELF_STATUS=0;APEX_PROC_STAT=0") + # Make sure the compiler can find include files from our Apex library. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_COMPILE_FLAGS}") include_directories (. ${APEX_SOURCE_DIR}/src/apex ${MPI_CXX_INCLUDE_PATH}) diff --git a/src/unit_tests/C/CMakeLists.txt b/src/unit_tests/C/CMakeLists.txt index fd5cdfc3..2bb98070 100644 --- a/src/unit_tests/C/CMakeLists.txt +++ b/src/unit_tests/C/CMakeLists.txt @@ -88,6 +88,7 @@ if(OpenACC_C_FOUND AND OpenACCProfiling_FOUND) endif(OpenACC_C_FOUND AND OpenACCProfiling_FOUND) set_tests_properties(test_apex_disable PROPERTIES ENVIRONMENT "APEX_DISABLE=1") +set_tests_properties(test_apex_version PROPERTIES ENVIRONMENT "APEX_PROC_SELF_STATUS=0;APEX_PROC_STAT=0") if(APEX_ERROR_HANDLING) set_tests_properties(test_crasher PROPERTIES WILL_FAIL TRUE) endif(APEX_ERROR_HANDLING)