summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2014-03-13 21:14:35 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-14 22:38:49 +0100
commitc4650779c41780f675a33025d09707c15055dda9 (patch)
tree597e18d046467ab0e733a80c6304e6cd5fca6d6a /tests
parentb14e4eb5f0a74e00be678c82d9e552b9e26ad91f (diff)
Fix tst_qthreadpool under high load.
The tasks might not have run yet at the time of the QCOMPARE, so we need to acquire on the semaphore in order to ensure that this is the case, just like in the previous testcase. Change-Id: I1da72bb07c2f53760b3bf912fc26aaf10ed18d48 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
index 859cd1b36a..0c91c419cc 100644
--- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
+++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
@@ -381,6 +381,7 @@ void tst_QThreadPool::expiryTimeoutRace() // QTBUG-3786
threadPool.start(&task);
QThread::msleep(50); // exactly the same as the expiry timeout
}
+ QVERIFY(task.semaphore.tryAcquire(numTasks, 10000));
QCOMPARE(task.runCount.load(), numTasks);
QVERIFY(threadPool.waitForDone(2000));
}