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

Prevent renaming from 'folder' to 'folder ' on Windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.4
    • Fix Version/s: 2.5.5
    • Component/s: Framework
    • Tags:
    • Story Points:
      2

      Description

      test_synchronize_windows_foldername_endswith_space() regularly fails:

      01:17:45.039 [INFO]      [exec] FAIL nuxeo-drive-client/tests/test_synchronization.py::TestSynchronization::test_synchronize_windows_foldername_endswith_space
      01:17:45.039 [INFO]      [exec] ================================== FAILURES ===================================
      01:17:45.039 [INFO]      [exec] ___ TestSynchronization.test_synchronize_windows_foldername_endswith_space ____
      01:17:45.039 [INFO]      [exec] self = <tests.test_synchronization.TestSynchronization testMethod=test_synchronize_windows_foldername_endswith_space>
      01:17:45.039 [INFO]      [exec]     def test_synchronize_windows_foldername_endswith_space(self):
      01:17:45.039 [INFO]      [exec]         """
      01:17:45.039 [INFO]      [exec]             Use nuxeodrive.CreateFolder API to make a folder directly under the workspace "trial ".
      01:17:45.039 [INFO]      [exec]             Verify if the DS client downloads the folder and trims the space at the end
      01:17:45.039 [INFO]      [exec]             """
      01:17:45.039 [INFO]      [exec]         top_level_children = self.remote_file_system_client_1.get_top_level_children()
      01:17:45.039 [INFO]      [exec]         target = self.remote_file_system_client_1.make_folder(top_level_children[0]['id'], 'trial ')
      01:17:45.039 [INFO]      [exec]         self.remote_file_system_client_1.make_file(target.uid, 'aFile.txt', u'File A Content')
      01:17:45.039 [INFO]      [exec]         self.remote_file_system_client_1.make_file(target.uid, 'bFile.txt', u'File B Content')
      01:17:45.039 [INFO]      [exec]         self.engine_1.start()
      01:17:45.039 [INFO]      [exec]         self.wait_sync(wait_for_async=True)
      01:17:45.039 [INFO]      [exec]         self.assertTrue(self.local_root_client_1.exists('/Nuxeo Drive Test Workspace'))
      01:17:45.039 [INFO]      [exec]         if AbstractOSIntegration.is_windows():
      01:17:45.039 [INFO]      [exec] >           self.assertTrue(self.local_root_client_1.exists('/Nuxeo Drive Test Workspace/trial/'), "Folder 'trial ' should be created without trailing space in the name")
      01:17:45.039 [INFO]      [exec] E           AssertionError: Folder 'trial ' should be created without trailing space in the name
      01:17:45.039 [INFO]      [exec] self       = <tests.test_synchronization.TestSynchronization testMethod=test_synchronize_windows_foldername_endswith_space>
      01:17:45.039 [INFO]      [exec] target     = RemoteFileInfo(name=u'trial ', uid=u'defaultFileSystemItemFactory#default#c846...te_child=True, lock_owner=None, lock_created=None, can_scroll_descendants=True)
      01:17:45.039 [INFO]      [exec] top_level_children = [{'canCreateChild': True, 'canDelete': True, 'canRename': True, 'canScrollDescendants': True, ...}]
      01:17:45.039 [INFO]      [exec] nuxeo-drive-client\tests\test_synchronization.py:756: AssertionError
      

      Full stack trace: https://qa.nuxeo.org/jenkins/view/Drive/job/Drive/job/FT-drive/job/master/277/execution/node/80/log/?consoleFull

      The interesting part is:

      01:17:45.044 [INFO]      [exec] 2017-10-02 22:09:07 3096 4528 DEBUG    nxdrive.engine.engine Local Folder locking on '/Nuxeo Drive Test Workspace/trial'
      01:17:45.044 [INFO]      [exec] 2017-10-02 22:09:07 3096 4528 DEBUG    nxdrive.engine.engine Local Folder lock setup completed on '/Nuxeo Drive Test Workspace/trial'
      01:17:45.044 [INFO]      [exec] 2017-10-02 22:09:07 3096 4528 DEBUG    nxdrive.engine.processor Renaming local folder u'\\\\?\\C:\\Jenkins\\0ebd1d51\\workspace\\Drive_FT-drive_master-CUACR5UOIAO62W7K2CAAQ7UISS5UUL3SF5V2PSVOUZC4CRBQLRIA\\tmp\\tmpgwo5crdrive-1\\Nuxeo Drive\\Nuxeo Drive Test Workspace\\trial' to u'trial '
      01:17:45.044 [INFO]      [exec] 2017-10-02 22:09:07 3096 4528 DEBUG    nxdrive.engine.engine Local Folder unlocking
      01:17:45.044 [INFO]      [exec] 2017-10-02 22:09:07 3096 4528 DEBUG    nxdrive.engine.workers Give up for error [DEDUP] (None) for <StateRow[3] local_path=u'/Nuxeo Drive Test Workspace/trial', remote_ref=u'defaultFileSystemItemFactory#default#c846990a-2503-4f4f-9ba6-1ffcbb30f133', local_state=u'synchronized', remote_state=u'modified', pair_state=u'remotely_modified'>
      01:17:45.044 [INFO]      [exec] 2017-10-02 22:09:07 3096 4528 DEBUG    nxdrive.engine.queue_manager Giving up on pair : <StateRow[3] local_path=u'/Nuxeo Drive Test Workspace/trial', remote_ref=u'defaultFileSystemItemFactory#default#c846990a-2503-4f4f-9ba6-1ffcbb30f133', local_state=u'synchronized', remote_state=u'modified', pair_state=u'remotely_modified'>
      01:17:45.044 [INFO]      [exec] 2017-10-02 22:09:07 3096 4528 TRACE    nxdrive.engine.processor Removing local_path on <StateRow[3] local_path=u'/Nuxeo Drive Test Workspace/trial', remote_ref=u'defaultFileSystemItemFactory#default#c846990a-2503-4f4f-9ba6-1ffcbb30f133', local_state=u'synchronized', remote_state=u'modified', pair_state=u'remotely_modified'>
      

      Where it tries to rename from the good folder name (without trailing space) to the bad one (with trailing space). And it ends with a DEDUP error as Windows does not take into account trailing spaces on folders/files.

        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, 5 hours, 30 minutes
                1d 5h 30m