Bug 1210055 - Intermittent Windows Talos failures like Unable to remove C:\slave\test-pgo\build. r=parkouss, a=test-only
authorJoel Maher <jmaher@mozilla.com>
Mon, 05 Oct 2015 17:11:18 -0400
changeset 296248 e869cbda78b5dad6a46ebfeb655cc6d352e5e66f
parent 296247 69e3fb393cadb76dcce0d74cc23105dc3939225b
child 296249 d50b9f101b1958098a80a92cf82cfbfcc4eb9628
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersparkouss, test-only
bugs1210055
milestone43.0a2
Bug 1210055 - Intermittent Windows Talos failures like Unable to remove C:\slave\test-pgo\build. r=parkouss, a=test-only
testing/mozharness/mozharness/base/script.py
--- a/testing/mozharness/mozharness/base/script.py
+++ b/testing/mozharness/mozharness/base/script.py
@@ -269,18 +269,23 @@ class ScriptMixin(PlatformMixin):
             name = ffrec[8]
             if name == '.' or name == '..':
                 continue
             full_name = os.path.join(path, name)
 
             if file_attr & win32file.FILE_ATTRIBUTE_DIRECTORY:
                 self._rmtree_windows(full_name)
             else:
-                win32file.SetFileAttributesW('\\\\?\\' + full_name, win32file.FILE_ATTRIBUTE_NORMAL)
-                win32file.DeleteFile('\\\\?\\' + full_name)
+                try:
+                    win32file.SetFileAttributesW('\\\\?\\' + full_name, win32file.FILE_ATTRIBUTE_NORMAL)
+                    win32file.DeleteFile('\\\\?\\' + full_name)
+                except:
+                    # DeleteFile fails on long paths, del /f /q works just fine
+                    self.run_command('del /F /Q "%s"' % full_name)
+
         win32file.RemoveDirectory('\\\\?\\' + path)
 
     def get_filename_from_url(self, url):
         """ parse a filename base on an url.
 
         Args:
             url (str): url to parse for the filename