diff options
author | Tamas Berghammer <tberghammer@google.com> | 2015-10-07 14:52:16 +0000 |
---|---|---|
committer | Tamas Berghammer <tberghammer@google.com> | 2015-10-07 14:52:16 +0000 |
commit | 11db2d3dddd704601893adc8a6517a8f9040a384 (patch) | |
tree | d7560ffc9e5fc950a3826d0db8c5fc80fbe5b0af | |
parent | 30d77777e7383afd5f1d73efc4f6fee99f577521 (diff) | |
download | bcm5719-llvm-11db2d3dddd704601893adc8a6517a8f9040a384.tar.gz bcm5719-llvm-11db2d3dddd704601893adc8a6517a8f9040a384.zip |
Fix race condition in the working directory cleanup code
llvm-svn: 249549
-rw-r--r-- | lldb/test/lldbtest.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py index b3bb23fca0e..efb678e22f3 100644 --- a/lldb/test/lldbtest.py +++ b/lldb/test/lldbtest.py @@ -2473,12 +2473,17 @@ class TestBase(Base): if error.Success(): lldb.remote_platform.SetWorkingDirectory(remote_test_dir) - def remove_working_dir(): + # This function removes all files from the current working directory while leaving + # the directories in place. The cleaup is required to reduce the disk space required + # by the test suit while leaving the directories untached is neccessary because + # sub-directories might belong to an other test + def clean_working_directory(): # TODO: Make it working on Windows when we need it for remote debugging support - # TODO: Add a command to SBPlatform/Platform to remove a (non empty) directory - shell_cmd = lldb.SBPlatformShellCommand("rm -rf %s" % remote_test_dir) + # TODO: Replace the heuristic to remove the files with a logic what collects the + # list of files we have to remove during test runs. + shell_cmd = lldb.SBPlatformShellCommand("rm %s/*" % remote_test_dir) lldb.remote_platform.Run(shell_cmd) - self.addTearDownHook(remove_working_dir) + self.addTearDownHook(clean_working_directory) else: print "error: making remote directory '%s': %s" % (remote_test_dir, error) |