diff --git a/nuxeo-drive-client/nxdrive/engine/processor.py b/nuxeo-drive-client/nxdrive/engine/processor.py index eab6ccc521..783416f584 100644 --- a/nuxeo-drive-client/nxdrive/engine/processor.py +++ b/nuxeo-drive-client/nxdrive/engine/processor.py @@ -559,7 +559,7 @@ def _synchronize_locally_created(self, doc_pair, local_client, if 'default#' in remote_ref: # Document appears to be deleted server side. self._synchronize_remotely_deleted( - doc_pair, local_client, remote_client) + doc_pair, local_client, remote_client, force=True) return try: @@ -1072,7 +1072,13 @@ def _create_remotely(self, local, remote, doc_pair, parent_pair, name): finally: self._lock_readonly(local, local_parent_path) - def _synchronize_remotely_deleted(self, doc_pair, local_client, remote_client): + def _synchronize_remotely_deleted( + self, + doc_pair, + local_client, + remote_client, + force=False + ): try: if doc_pair.local_state != 'deleted': log.debug('Deleting locally %r', local_client.abspath(doc_pair.local_path)) @@ -1083,10 +1089,10 @@ def _synchronize_remotely_deleted(self, doc_pair, local_client, remote_client): file_out = self._get_temporary_file(local_client.abspath(doc_pair.local_path)) if os.path.exists(file_out): os.remove(file_out) - if self._engine.use_trash(): - local_client.delete(doc_pair.local_path) - else: + if force or not self._engine.use_trash(): local_client.delete_final(doc_pair.local_path) + else: + local_client.delete(doc_pair.local_path) self._dao.remove_state(doc_pair) self._search_for_dedup(doc_pair) finally: diff --git a/nuxeo-drive-client/tests/test_synchronization.py b/nuxeo-drive-client/tests/test_synchronization.py index e0af582814..7de3a0323e 100644 --- a/nuxeo-drive-client/tests/test_synchronization.py +++ b/nuxeo-drive-client/tests/test_synchronization.py @@ -475,45 +475,6 @@ def test_conflict_detection(self): self.assertEqual(remote_children[0].filename, 'Some File.doc') self.assertEqual(remote_1.get_content('/Some File.doc'), 'Remote new content.') - def test_synchronize_deep_folders(self): - # Increase Automation execution timeout for NuxeoDrive.GetChangeSummary - # because of the recursive parent FileSystemItem adaptation - self.engine_1.timeout = 90 - - # Create a file deep down in the hierarchy - remote = self.remote_document_client_1 - - folder_name = '0123456789' - folder_depth = 40 - folder = '/' - for _ in range(folder_depth): - folder = remote.make_folder(folder, folder_name) - - remote.make_file(folder, "File.odt", content="Fake non-zero content.") - - # Wait for ES indexing - self.wait() - self.engine_1.start() - self.wait_sync(timeout=90) - - local = self.local_client_1 - expected_folder_path = ('/' + folder_name) * folder_depth - - expected_file_path = expected_folder_path + '/File.odt' - self.assertTrue(local.exists(expected_folder_path)) - self.assertTrue(local.exists(expected_file_path)) - self.assertEqual(local.get_content(expected_file_path), - "Fake non-zero content.") - - # Delete the nested folder structure on the remote server - # and synchronize again - remote.delete('/' + folder_name) - - self.wait_sync(wait_for_async=True, timeout=90) - - self.assertFalse(local.exists(expected_folder_path)) - self.assertFalse(local.exists(expected_file_path)) - def test_create_content_in_readonly_area(self): self.engine_1.start() self.wait_sync(wait_for_async=True) diff --git a/tools/jenkins/tests.groovy b/tools/jenkins/tests.groovy index 72b0e9f97a..ebf3ce73b4 100644 --- a/tools/jenkins/tests.groovy +++ b/tools/jenkins/tests.groovy @@ -188,7 +188,7 @@ timeout(240) { timestamps { parallel builders - if (env.ENABLE_SONAR && currentBuild.result != 'UNSTABLE') { + if (env.ENABLE_SONAR && currentBuild.result != 'UNSTABLE' && env.SPECIFIC_TEST == '') { node('SLAVE') { stage('SonarQube Analysis') { try {