Fix TestSyncEngine::abortAfterFailedMkdir
authorJocelyn Turcotte <jturcotte@woboq.com>
Wed, 8 Feb 2017 16:31:13 +0000 (17:31 +0100)
committerJocelyn Turcotte <jturcotte@woboq.com>
Wed, 8 Feb 2017 16:32:04 +0000 (17:32 +0100)
It could be possible that _firstJob is marked as finished if
aborted before its parent PropagateDirectory was marked as finished,
allowing a posted scheduleNextJob call to schedule the child job
in-between.

src/libsync/owncloudpropagator.cpp
src/libsync/owncloudpropagator.h
test/testsyncengine.cpp

index ada9189807275350158753dbe4afa72cf3d64f15..3573ffd2411c30ec7048b26bf4bac6a6d73f11d1 100644 (file)
@@ -662,7 +662,7 @@ void PropagateDirectory::slotSubJobFinished(SyncFileItem::Status status)
     bool wasFirstJob = false;
     if (subJob == _firstJob.data()) {
         wasFirstJob = true;
-        _firstJob.reset();
+        _firstJob.take();
     } else {
         int i = _subJobs.indexOf(subJob);
         ASSERT(i >= 0);
index 4c06fcf3ee34611377b7e6ebacd5d022432b3a81..85fb3240a63f46bc8be68bf159401cf70d21f2fa 100644 (file)
@@ -227,7 +227,7 @@ public:
 private slots:
     bool possiblyRunNextJob(PropagatorJob *next) {
         if (next->_state == NotYetStarted) {
-            connect(next, SIGNAL(finished(SyncFileItem::Status)), this, SLOT(slotSubJobFinished(SyncFileItem::Status)), Qt::QueuedConnection);
+            connect(next, SIGNAL(finished(SyncFileItem::Status)), this, SLOT(slotSubJobFinished(SyncFileItem::Status)));
             connect(next, SIGNAL(itemCompleted(const SyncFileItemPtr &)), this, SIGNAL(itemCompleted(const SyncFileItemPtr &)));
             connect(next, SIGNAL(progress(const SyncFileItem &,quint64)), this, SIGNAL(progress(const SyncFileItem &,quint64)));
             connect(next, SIGNAL(ready()), this, SIGNAL(ready()));
index ae5296ea1e48de55805b0d7eb75a0cfe6e9a96df..31f15df8e9629f9311e4e51b04534847a41600f7 100644 (file)
@@ -214,7 +214,6 @@ private slots:
     }
 
     void abortAfterFailedMkdir() {
-        QSKIP("Skip for 2.3");
         FakeFolder fakeFolder{FileInfo{}};
         QSignalSpy finishedSpy(&fakeFolder.syncEngine(), SIGNAL(finished(bool)));
         fakeFolder.serverErrorPaths().append("NewFolder");