summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2023-12-12 14:51:01 +0200
committerAssam Boudjelthia <assam.boudjelthia@qt.io>2023-12-15 02:52:25 +0200
commit97e4f9902e9133b8e512a8a6f3a9836641e8845d (patch)
tree69626d86d7e024d3b34240d0ed56ef0cfe106137
parent96527507c4ce52d578b15572dc4956e6341a4c4c (diff)
CMake:Android:Coin: prioritize timeout from COIN_COMMAND_OUTPUT_TIMEOUT
... from CMake so that Coin doesn't end up killing the whole VM if aRows test gets stuck and instead allow androidtestrunner to cleanup and fetch the logs so we know what happened, and even potentially ending up re-run the test and succeeding if it was flaky. Also, since CMake sets the timeout during configuration time, coin needs to set COIN_COMMAND_OUTPUT_TIMEOUT under the build target where tests are configured, so this moves the setting of that env var from the test target to the build target. Pick-to: 6.5 Change-Id: I9883ea1e98c93f79a088067518d09ca8acd5fdfd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 3ee2ecd6bfdf3320e66628afa5d017783df2ee91) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 5ebce47ac417c51e0a2a027eb873a91f1c703e16)
-rw-r--r--cmake/QtTestHelpers.cmake9
-rw-r--r--coin/instructions/cmake_run_ctest_enforce_exit_code.yaml15
-rw-r--r--coin/instructions/prepare_building_env.yaml15
3 files changed, 22 insertions, 17 deletions
diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake
index f5470db9fd..a8f43832af 100644
--- a/cmake/QtTestHelpers.cmake
+++ b/cmake/QtTestHelpers.cmake
@@ -809,8 +809,13 @@ endfunction()
function(qt_internal_get_android_test_timeout input_timeout percentage output_timeout_var)
set(actual_timeout "${input_timeout}")
if(NOT actual_timeout)
- # Related: https://gitlab.kitware.com/cmake/cmake/-/issues/20450
- if(DART_TESTING_TIMEOUT)
+ # we have coin ci timeout set use that to avoid having the emulator killed
+ # so we can at least get some logs from the android test runner.
+ set(coin_timeout $ENV{COIN_COMMAND_OUTPUT_TIMEOUT})
+ if(coin_timeout)
+ set(actual_timeout "${coin_timeout}")
+ elseif(DART_TESTING_TIMEOUT)
+ # Related: https://gitlab.kitware.com/cmake/cmake/-/issues/20450
set(actual_timeout "${DART_TESTING_TIMEOUT}")
elseif(CTEST_TEST_TIMEOUT)
set(actual_timeout "${CTEST_TEST_TIMEOUT}")
diff --git a/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml b/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml
index 097b6d6364..81c35dd227 100644
--- a/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml
+++ b/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml
@@ -83,21 +83,6 @@ instructions:
env_var: CMAKE_MIN_SUPPORTED_BIN_PATH
equals_value: null
- - type: EnvironmentVariable
- variableName: COIN_COMMAND_OUTPUT_TIMEOUT
- variableValue: "900"
- disable_if:
- condition: property
- property: features
- contains_value: UseAddressSanitizer
- - type: EnvironmentVariable
- variableName: COIN_COMMAND_OUTPUT_TIMEOUT
- variableValue: "10800"
- enable_if:
- condition: property
- property: features
- contains_value: UseAddressSanitizer
-
- type: ExecuteCommand
command: "{{.Env.TESTS_ENV_PREFIX}} ctest {{.Env.CTEST_ARGS}}"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
diff --git a/coin/instructions/prepare_building_env.yaml b/coin/instructions/prepare_building_env.yaml
index 53fc2ae60c..d0159fc9e1 100644
--- a/coin/instructions/prepare_building_env.yaml
+++ b/coin/instructions/prepare_building_env.yaml
@@ -587,3 +587,18 @@ instructions:
condition: property
property: host.os
equals_value: Windows
+
+ - type: EnvironmentVariable
+ variableName: COIN_COMMAND_OUTPUT_TIMEOUT
+ variableValue: "900"
+ disable_if:
+ condition: property
+ property: features
+ contains_value: UseAddressSanitizer
+ - type: EnvironmentVariable
+ variableName: COIN_COMMAND_OUTPUT_TIMEOUT
+ variableValue: "10800"
+ enable_if:
+ condition: property
+ property: features
+ contains_value: UseAddressSanitizer