From e5a8b3670493fc5e72571d29f87445618dc60e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tinja=20Paavosepp=C3=A4?= Date: Tue, 27 Feb 2024 13:16:16 +0200 Subject: [PATCH] Android: Make timeout in tst_QApplication::abortQuitOnShow() longer Since the Android emulator on CI is running without hardware accelerated graphics, showing the widget can take almost the same time as the timeout for exiting the app with the "wrong" exit code 1. If running on Android, increase the timeout to 1000 ms to avoid flaky failures. Un-blacklist tst_QApplication::abortQuitOnShow() since the random failures are taken care of by this patch. Task-number: QTBUG-122693 Change-Id: Id52ae15b3ab2dbdaf4924b675276dfe3a4168585 Reviewed-by: Assam Boudjelthia (cherry picked from commit 32197e94d79f9bb00ddb9c294bd2711dba47d1ee) --- tests/auto/widgets/kernel/qapplication/BLACKLIST | 4 ---- .../auto/widgets/kernel/qapplication/tst_qapplication.cpp | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/auto/widgets/kernel/qapplication/BLACKLIST b/tests/auto/widgets/kernel/qapplication/BLACKLIST index bf6ece58fcc..c68c7d6b149 100644 --- a/tests/auto/widgets/kernel/qapplication/BLACKLIST +++ b/tests/auto/widgets/kernel/qapplication/BLACKLIST @@ -1,7 +1,3 @@ [touchEventPropagation] # QTBUG-66745 opensuse-leap - -[abortQuitOnShow] -# QTBUG-122693 -android diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 8867be32dd3..6e1304934e0 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -2576,7 +2576,13 @@ public: : QWidget(parent), showAgain(showAgain) { QTimer::singleShot(0, this, &ShowCloseShowWidget::doClose); - QTimer::singleShot(500, this, [] () { QCoreApplication::exit(1); }); + int timeout = 500; +#ifdef Q_OS_ANDROID + // On Android, CI Android emulator is not running HW accelerated graphics and can be slow, + // use a longer timeout to avoid flaky failures + timeout = 1000; +#endif + QTimer::singleShot(timeout, this, [] () { QCoreApplication::exit(1); }); } private slots: