From d3ed10bb9ca71d2b2dadf76f9d98b06943dddde7 Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Wed, 11 May 2022 16:50:29 +0200 Subject: Disable the Wayland watchdog when running autotests If tests are running into timeouts in the CI, we most of run into the Wayland timeout before, messing up the tests' results. Change-Id: I054f07ff860f77a1e8dfd6a411b049b92555dad0 Reviewed-by: Dominik Holland (cherry picked from commit 26191b87f30dccff436736c13a62d19a665ae2a0) Reviewed-by: Robert Griebl --- src/main-lib/configuration.cpp | 7 ++++++- src/main-lib/configuration.h | 2 ++ src/main-lib/main.cpp | 6 +++--- src/main-lib/main.h | 2 +- src/tools/appman/appman.cpp | 1 + tests/qml/windowmapping/tst_windowmapping.qml | 2 ++ 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/main-lib/configuration.cpp b/src/main-lib/configuration.cpp index 5e77430e..3fb6988b 100644 --- a/src/main-lib/configuration.cpp +++ b/src/main-lib/configuration.cpp @@ -1106,7 +1106,12 @@ bool Configuration::allowUnknownUiClients() const bool Configuration::noUiWatchdog() const { - return value("no-ui-watchdog", m_data->flags.noUiWatchdog); + return value("no-ui-watchdog", m_data->flags.noUiWatchdog) || m_forceNoUiWatchdog; +} + +void Configuration::setForceNoUiWatchdog(bool noUiWatchdog) +{ + m_forceNoUiWatchdog = noUiWatchdog; } bool Configuration::noDltLogging() const diff --git a/src/main-lib/configuration.h b/src/main-lib/configuration.h index e2fd49d1..3bdc1b48 100644 --- a/src/main-lib/configuration.h +++ b/src/main-lib/configuration.h @@ -97,6 +97,7 @@ public: bool allowUnsignedPackages() const; bool allowUnknownUiClients() const; bool noUiWatchdog() const; + void setForceNoUiWatchdog(bool noUiWatchdog); bool noDltLogging() const; bool forceSingleProcess() const; bool forceMultiProcess() const; @@ -163,6 +164,7 @@ private: QString m_mainQmlFile; bool m_onlyOnePositionalArgument = false; bool m_forceVerbose = false; + bool m_forceNoUiWatchdog = false; mutable QString m_installationDir; // cached value mutable QString m_documentDir; // cached value }; diff --git a/src/main-lib/main.cpp b/src/main-lib/main.cpp index be656810..334ea1e4 100644 --- a/src/main-lib/main.cpp +++ b/src/main-lib/main.cpp @@ -697,12 +697,12 @@ void Main::setupWindowTitle(const QString &title, const QString &iconPath) } void Main::setupWindowManager(const QString &waylandSocketName, const QVariantList &waylandExtraSockets, - bool slowAnimations, bool uiWatchdog, bool allowUnknownUiClients) + bool slowAnimations, bool noUiWatchdog, bool allowUnknownUiClients) { #if defined(AM_HEADLESS) Q_UNUSED(waylandSocketName) Q_UNUSED(slowAnimations) - Q_UNUSED(uiWatchdog) + Q_UNUSED(noUiWatchdog) Q_UNUSED(allowUnknownUiClients) #else QUnifiedTimer::instance()->setSlowModeEnabled(slowAnimations); @@ -710,7 +710,7 @@ void Main::setupWindowManager(const QString &waylandSocketName, const QVariantLi m_windowManager = WindowManager::createInstance(m_engine, waylandSocketName); m_windowManager->setAllowUnknownUiClients(m_noSecurity || allowUnknownUiClients); m_windowManager->setSlowAnimations(slowAnimations); - m_windowManager->enableWatchdog(!uiWatchdog); + m_windowManager->enableWatchdog(!noUiWatchdog); #if defined(QT_WAYLANDCOMPOSITOR_LIB) connect(&m_windowManager->internalSignals, &WindowManagerInternalSignals::compositorAboutToBeCreated, diff --git a/src/main-lib/main.h b/src/main-lib/main.h index e48b442a..e2d9f798 100644 --- a/src/main-lib/main.h +++ b/src/main-lib/main.h @@ -130,7 +130,7 @@ protected: void setupQmlEngine(const QStringList &importPaths, const QString &quickControlsStyle = QString()); void setupWindowTitle(const QString &title, const QString &iconPath); void setupWindowManager(const QString &waylandSocketName, const QVariantList &waylandExtraSockets, - bool slowAnimations, bool uiWatchdog, bool allowUnknownUiClients); + bool slowAnimations, bool noUiWatchdog, bool allowUnknownUiClients); void setupTouchEmulation(bool enableTouchEmulation); void setupShellServer(const QString &telnetAddress, quint16 telnetPort) Q_DECL_NOEXCEPT_EXPR(false); diff --git a/src/tools/appman/appman.cpp b/src/tools/appman/appman.cpp index 041dc2bb..8a18d7de 100644 --- a/src/tools/appman/appman.cpp +++ b/src/tools/appman/appman.cpp @@ -106,6 +106,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) #if defined(AM_TESTRUNNER) TestRunner::initialize(cfg.mainQmlFile(), cfg.testRunnerArguments()); cfg.setForceVerbose(qEnvironmentVariableIsSet("AM_VERBOSE_TEST")); + cfg.setForceNoUiWatchdog(true); // this messes up test results on slow CI systems otherwise #endif a.setup(&cfg); #if defined(AM_TESTRUNNER) diff --git a/tests/qml/windowmapping/tst_windowmapping.qml b/tests/qml/windowmapping/tst_windowmapping.qml index 63a3c00e..cf176497 100644 --- a/tests/qml/windowmapping/tst_windowmapping.qml +++ b/tests/qml/windowmapping/tst_windowmapping.qml @@ -276,6 +276,8 @@ TestCase { if (ApplicationManager.singleProcess) skip("Wayland ping-pong is only supported in multi-process mode"); + else + skip("Wayland ping-pong is disabled in the testrunner due to interferences with other tests"); AmTest.ignoreMessage(AmTest.CriticalMsg, /Stopping application.*because we did not receive a Wayland-Pong/); app.start(); -- cgit v1.2.1