Skip to content

Commit

Permalink
CMake:Android:Coin: prioritize timeout from COIN_COMMAND_OUTPUT_TIMEOUT
Browse files Browse the repository at this point in the history
... 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.7 6.6 6.5
Change-Id: I9883ea1e98c93f79a088067518d09ca8acd5fdfd
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
Issam-b committed Dec 13, 2023
1 parent 53f3013 commit 3ee2ecd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
9 changes: 7 additions & 2 deletions cmake/QtTestHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,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}")
Expand Down
15 changes: 0 additions & 15 deletions coin/instructions/cmake_run_ctest_enforce_exit_code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,6 @@ instructions:

- !include "{{qt/qtbase}}/coin_module_test_android_start_emulator.yaml"

- 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
Expand Down
15 changes: 15 additions & 0 deletions coin/instructions/prepare_building_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -608,3 +608,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

0 comments on commit 3ee2ecd

Please sign in to comment.