From 81723f2b5da71ca1b3ec797974285f8d3cbc819b Mon Sep 17 00:00:00 2001
From: Pierre Lamot <pierre@videolabs.io>
Date: Thu, 13 Mar 2025 15:10:41 +0100
Subject: [PATCH] qt: remove explicit timeout in test_ml_model

Our CI tend to run tests extremely slowly when heavy loaded. Qt tests will
timeout by themselves after a global timeout and exit gracefully. As these
checks are not supposed to timeout we can just remove the explicit timeout with
no penalty for the case where the test runs under normal conditions.

fix: #29077
---
 modules/gui/qt/tests/test_ml_model.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt/tests/test_ml_model.cpp b/modules/gui/qt/tests/test_ml_model.cpp
index 7ecc788b944..bf6fc5306bd 100644
--- a/modules/gui/qt/tests/test_ml_model.cpp
+++ b/modules/gui/qt/tests/test_ml_model.cpp
@@ -175,10 +175,8 @@ private slots:
         const int high = 300;
         m_model->appendRange(low, high);
 
-        const int timeout = 1000;
-
         // let loading complete, getIndexFromID won't work for 'loading' model
-        QVERIFY(QTest::qWaitFor([this] () { return !m_model->loading(); }, timeout));
+        QVERIFY(QTest::qWaitFor([this] () { return !m_model->loading(); }));
 
         std::optional<int> row = -1;
         auto cb = [&row](std::optional<int> index)
@@ -190,7 +188,7 @@ private slots:
         m_model->getIndexFromId2(MLItemId{high, VLC_ML_PARENT_UNKNOWN}, cb);
 
         // NOTE: CI fails with QTRY_COMPARE_WITH_TIMEOUT
-        QVERIFY(QTest::qWaitFor([&row]() { return row != -1; }, timeout));
+        QVERIFY(QTest::qWaitFor([&row]() { return row != -1; }));
         QCOMPARE(row, high - 1);
 
         // above we must have loaded all the data, following this we should not need to wait for results
-- 
GitLab