Use resource lock to avoid concurrent execution of tests requiring Syncthing test instance
This is likely the cleaner approach compared to just enforcing a serial run for the CLI test.
This commit is contained in:
parent
1f74a82ecb
commit
3b50d78f1e
|
@ -44,7 +44,7 @@ include(ShellCompletion)
|
||||||
include(Doxygen)
|
include(Doxygen)
|
||||||
include(ConfigHeader)
|
include(ConfigHeader)
|
||||||
|
|
||||||
# avoid running this test in parallel with other tests as it interferes with the connector test
|
# avoid running this test in parallel with other tests spawning a Syncthing test instance
|
||||||
if (META_MAIN_TEST_NAME)
|
if (META_MAIN_TEST_NAME)
|
||||||
set_tests_properties("${META_MAIN_TEST_NAME}" PROPERTIES RUN_SERIAL TRUE)
|
set_tests_properties("${META_MAIN_TEST_NAME}" PROPERTIES RESOURCE_LOCK "syncthingtestinstance")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
@ -137,5 +137,10 @@ include(LibraryTarget)
|
||||||
list(APPEND TEST_LIBRARIES syncthingtesthelper)
|
list(APPEND TEST_LIBRARIES syncthingtesthelper)
|
||||||
include(TestTarget)
|
include(TestTarget)
|
||||||
|
|
||||||
|
# avoid running this test in parallel with other tests spawning a Syncthing test instance
|
||||||
|
if (META_MAIN_TEST_NAME)
|
||||||
|
set_tests_properties("${META_MAIN_TEST_NAME}" PROPERTIES RESOURCE_LOCK "syncthingtestinstance")
|
||||||
|
endif ()
|
||||||
|
|
||||||
include(Doxygen)
|
include(Doxygen)
|
||||||
include(ConfigHeader)
|
include(ConfigHeader)
|
||||||
|
|
|
@ -248,3 +248,8 @@ if (NOT BUILD_SHARED_LIBS
|
||||||
DESTINATION "lib${SELECTED_LIB_SUFFIX}"
|
DESTINATION "lib${SELECTED_LIB_SUFFIX}"
|
||||||
COMPONENT binary)
|
COMPONENT binary)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# avoid running this test in parallel with other tests spawning a Syncthing test instance
|
||||||
|
if (META_MAIN_TEST_NAME)
|
||||||
|
set_tests_properties("${META_MAIN_TEST_NAME}" PROPERTIES RESOURCE_LOCK "syncthingtestinstance")
|
||||||
|
endif ()
|
||||||
|
|
|
@ -49,3 +49,8 @@ include(ConfigHeader)
|
||||||
|
|
||||||
# exclude the target from 'all' target so it is only built when tests are built
|
# exclude the target from 'all' target so it is only built when tests are built
|
||||||
set_target_properties("${META_TARGET_NAME}" PROPERTIES EXCLUDE_FROM_ALL ON)
|
set_target_properties("${META_TARGET_NAME}" PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||||
|
|
||||||
|
# avoid running this test in parallel with other tests spawning a Syncthing test instance
|
||||||
|
if (META_MAIN_TEST_NAME)
|
||||||
|
set_tests_properties("${META_MAIN_TEST_NAME}" PROPERTIES RESOURCE_LOCK "syncthingtestinstance")
|
||||||
|
endif ()
|
||||||
|
|
Loading…
Reference in New Issue