Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-1329

Fix test_synchronize_remote_deletion_while_download_file on Windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0.0
    • Fix Version/s: 4.0.0
    • Component/s: Tests
    • Environment:
      Windows

      Description

      tests/test_remote_deletion.py::TestRemoteDeletion::test_synchronize_remote_deletion_while_download_file FAILED [100%]
      
      ================================== FAILURES ===================================
      ___ TestRemoteDeletion.test_synchronize_remote_deletion_while_download_file ___
      
      self = <tests.test_remote_deletion.TestRemoteDeletion testMethod=test_synchronize_remote_deletion_while_download_file>
      
          @pytest.mark.randombug("NXDRIVE-0", condition=True, mode="STRICT")
          def test_synchronize_remote_deletion_while_download_file(self):
              if WINDOWS:
      >           self._remote_deletion_while_download_file()
      
      self       = <tests.test_remote_deletion.TestRemoteDeletion testMethod=test_synchronize_remote_deletion_while_download_file>
      
      tests\test_remote_deletion.py:146: 
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
      
      self = <tests.test_remote_deletion.TestRemoteDeletion testMethod=test_synchronize_remote_deletion_while_download_file>
      
          def _remote_deletion_while_download_file(self):
              local = self.local_1
              remote = self.remote_document_client_1
          
              def check_suspended(*_):
                  """ Add delay when upload and download. """
                  if not self.engine_1.has_delete:
                      # Delete remote file while downloading
                      try:
                          remote.delete("/Test folder/testFile.pdf")
                      except:
                          log.exception("Deletion error")
                      else:
                          self.engine_1.has_delete = True
                  time.sleep(1)
                  self.engine_1.suspend_client()
          
              self.engine_1.start()
              self.engine_1.has_delete = False
          
              with patch.object(self.engine_1.remote, "check_suspended", new=check_suspended):
                  # Create documents in the remote root workspace
                  remote.make_folder("/", "Test folder")
                  with open(self.location + "/resources/testFile.pdf", "rb") as pdf:
                      remote.make_file("/Test folder", "testFile.pdf", pdf.read())
          
                  self.wait_sync(wait_for_async=True)
      >           assert not local.exists("/Test folder/testFile.pdf")
      E           AssertionError: assert not True
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour
                1d 1h