Fix of flaky qFutureAssignmentLeak test
Switch to QTRY_COMPARE since thread-local references might be held shortly after finished is signalled. Change-Id: Ia32f1f45f6cc461352558e0f2acf9612f8a4639e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
dc334b60d9
commit
5e98873cd3
@ -1,3 +0,0 @@
|
||||
[qFutureAssignmentLeak]
|
||||
ci opensuse
|
||||
ci ubuntu-16.04
|
@ -2402,9 +2402,12 @@ void tst_QtConcurrentMap::qFutureAssignmentLeak()
|
||||
future.waitForFinished();
|
||||
}
|
||||
|
||||
QCOMPARE(currentInstanceCount.load(), 1000);
|
||||
// Use QTRY_COMPARE because QtConcurrent::ThreadEngine::asynchronousFinish()
|
||||
// deletes its internals after signaling finished, so it might still be holding
|
||||
// on to copies of InstanceCounter for a short while.
|
||||
QTRY_COMPARE(currentInstanceCount.load(), 1000);
|
||||
future = QFuture<InstanceCounter>();
|
||||
QCOMPARE(currentInstanceCount.load(), 0);
|
||||
QTRY_COMPARE(currentInstanceCount.load(), 0);
|
||||
}
|
||||
|
||||
inline void increment(int &num)
|
||||
|
Loading…
x
Reference in New Issue
Block a user