Make test pass on machines with many cores

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 <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Lars Knoll 2020-09-04 10:31:41 +02:00
parent 3d7d8346dd
commit bbc19bd979

View File

@ -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);
}