Android: Disable androidtestrunner extra timeout

We already have:

a, a timeout as part of QtTest. By default it lets each test function
   run for 5 minutes. This timeout can be configured using
   QTEST_FUNCTION_TIMEOUT.
b, maxTimeBetweenOutput in the CI. The CI will kill the process if too
   much time passes between individual output lines of a test.
c, maxTimeInSeconds in the CI. This does exactly the same as the
   androidtestrunner timeout.

The CI timeouts can be centrally tuned per platform and Qt module. This
is preferable over a special timeout just for android.

As other people may be using androidtestrunner for unrelated projects,
don't delete the timeout, but simply disable it from CMake by setting
it to -1.

Task-number: QTBUG-106479
Task-number: QTBUG-101596
Task-number: QTBUG-100242
Change-Id: If4ce00948e204182bb12ac4859d3b0dd193de7ad
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Ulf Hermann 2022-09-19 15:48:27 +02:00
parent a1e19c4a8c
commit 00b9409843
2 changed files with 3 additions and 1 deletions

View File

@ -203,6 +203,7 @@ function(qt_internal_android_test_arguments target out_test_runner out_test_argu
"--skip-install-root" "--skip-install-root"
"--make" "${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target}_make_apk" "--make" "${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target}_make_apk"
"--apk" "${apk_dir}/${target}.apk" "--apk" "${apk_dir}/${target}.apk"
"--timeout" "-1"
"--verbose" "--verbose"
PARENT_SCOPE PARENT_SCOPE
) )

View File

@ -397,7 +397,8 @@ static bool waitToFinish()
// Wait to finish // Wait to finish
while (isRunning()) { while (isRunning()) {
std::this_thread::sleep_for(std::chrono::milliseconds(250)); std::this_thread::sleep_for(std::chrono::milliseconds(250));
if ((clock::now() - start) > g_options.timeout) if (g_options.timeout >= std::chrono::seconds::zero()
&& (clock::now() - start) > g_options.timeout)
return false; return false;
} }
return true; return true;