From bbc19bd9795ad873d4ff7c8f793aaff554c6b3eb Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 4 Sep 2020 10:31:41 +0200 Subject: [PATCH] Make test pass on machines with many cores MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just starting 20 threads to test this won't cut it if the machine you're testing on has an ideal thread count of 16 or larger. Change-Id: Icba8f00aa836fec6da41c71b318e9e17bdd47c0e Reviewed-by: Volker Hilsheimer Reviewed-by: MÃ¥rten Nordheim --- tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp index 74563a9c40..1d3d75d930 100644 --- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp +++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp @@ -799,7 +799,7 @@ void tst_QThreadPool::tryStartPeakThreadCount() CounterTask task; QThreadPool threadPool; - for (int i = 0; i < 20; ++i) { + for (int i = 0; i < 4*QThread::idealThreadCount(); ++i) { if (threadPool.tryStart(&task) == false) QTest::qWait(10); }