[debuginfo-tests] 0a3b083 - [debuginfo-tests] Warn, not error, if we can't delete working directory

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 05:16:31 PST 2020


Author: Jeremy Morse
Date: 2020-02-25T13:15:07Z
New Revision: 0a3b0837915e9796ae4279fe704efa663b89d815

URL: https://github.com/llvm/llvm-project/commit/0a3b0837915e9796ae4279fe704efa663b89d815
DIFF: https://github.com/llvm/llvm-project/commit/0a3b0837915e9796ae4279fe704efa663b89d815.diff

LOG: [debuginfo-tests] Warn, not error, if we can't delete working directory

On Windows, an error running the debugger typically leaves a process
hanging around in the working directory. When Dexter exits, it can't then
delete the working directory and produces an exception, masking the problem
in the debugger. (This can be worked around by specifying --save-temps).
Rather than hard-erroring, print a warning when we can't delete the working
directory instead.

It'd be much better to improve our error handling, and make the
WorkingDirectory class aware that something's wrong when it enters exit.
However, this is something that's going to mask genuine errors and make
everyones lives harder right now, so I think this non-ideal fix is
important to get in first.

Differential Revision: https://reviews.llvm.org/D74548

Added: 
    

Modified: 
    debuginfo-tests/dexter/dex/utils/WorkingDirectory.py

Removed: 
    


################################################################################
diff  --git a/debuginfo-tests/dexter/dex/utils/WorkingDirectory.py b/debuginfo-tests/dexter/dex/utils/WorkingDirectory.py
index e1862f2db728..04f9b6435334 100644
--- a/debuginfo-tests/dexter/dex/utils/WorkingDirectory.py
+++ b/debuginfo-tests/dexter/dex/utils/WorkingDirectory.py
@@ -12,7 +12,7 @@
 import time
 
 from dex.utils.Exceptions import Error
-
+from dex.utils.Warning import warn
 
 class WorkingDirectory(object):
     def __init__(self, context, *args, **kwargs):
@@ -35,12 +35,12 @@ def __exit__(self, *args):
                 self.path))
             return
 
-        exception = AssertionError('should never be raised')
         for _ in range(100):
             try:
                 shutil.rmtree(self.path)
                 return
-            except OSError as e:
-                exception = e
+            except OSError:
                 time.sleep(0.1)
-        raise Error(exception)
+
+        warn(self.context, '"{}" left in place (couldn\'t delete)\n'.format(self.path))
+        return


        


More information about the llvm-commits mailing list