aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/api
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-05-29 16:27:08 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2017-05-30 08:28:27 +0000
commited342b0beda9ff171906043bac99b82105156cb5 (patch)
tree9f92f03bc26dc8db42e026393e86e6deb20aba66 /tests/auto/api
parent1a4456c233b73ab08f7003b0196a30ae408b5c86 (diff)
Fix race condition when resolving projects
Make sure we do not actually start resolving before returning to the code that created the job object. Otherwise signals could be missed. Change-Id: I2cf3db7c0777e2f6315c95ee15a21695f8b22c11 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/api')
-rw-r--r--tests/auto/api/tst_api.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp
index d2b5bcc47..99af1cf52 100644
--- a/tests/auto/api/tst_api.cpp
+++ b/tests/auto/api/tst_api.cpp
@@ -46,6 +46,7 @@
#include <QtCore/qregularexpression.h>
#include <QtCore/qscopedpointer.h>
#include <QtCore/qstringlist.h>
+#include <QtCore/qthread.h>
#include <QtCore/qtimer.h>
#include <QtTest/qtest.h>
@@ -305,6 +306,7 @@ void TestApi::buildGraphLocking()
// Case 4: Changing the build directory again, but cancelling the job.
setupJob.reset(project3.setupProject(setupParams2, m_logSink, 0));
+ QThread::sleep(1);
setupJob->cancel();
waitForFinished(setupJob.data());
QVERIFY(setupJob->error().hasError());