From c4650779c41780f675a33025d09707c15055dda9 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 13 Mar 2014 21:14:35 +0100 Subject: 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 Reviewed-by: Friedemann Kleint --- tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') 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)); } -- cgit v1.2.3