summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAssam Boudjelthia <[email protected]>2023-12-12 14:51:01 +0200
committerQt Cherry-pick Bot <[email protected]>2023-12-15 05:26:10 +0000
commiteb8d1850c7b9468a2e89fb44f5d1e442d1ff5078 (patch)
treebcb506ed27e3d74b095b8d1ee424b68f2fac7b73
parentf931facd077ce945f1e42eaa3bead208822d3e00 (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. Change-Id: I9883ea1e98c93f79a088067518d09ca8acd5fdfd Reviewed-by: Alexandru Croitor <[email protected]> (cherry picked from commit 3ee2ecd6bfdf3320e66628afa5d017783df2ee91) Reviewed-by: Qt Cherry-pick Bot <[email protected]> (cherry picked from commit 5ebce47ac417c51e0a2a027eb873a91f1c703e16) (cherry picked from commit 97e4f9902e9133b8e512a8a6f3a9836641e8845d)
-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 21ec4f39a7e..c788d8e3fba 100644
--- a/cmake/QtTestHelpers.cmake
+++ b/cmake/QtTestHelpers.cmake
@@ -749,8 +749,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 097b6d6364e..81c35dd2273 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 53fc2ae60c0..d0159fc9e1f 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