diff options
author | 2015-09-09 12:41:05 +0000 | |
---|---|---|
committer | 2015-09-09 17:35:02 +0000 | |
commit | 7728c8f50be72727cb1a20f60c011548f27e6212 (patch) | |
tree | 168399d2c28fbf437255e0a439e3dcde2b7bf853 /src/main/java/com | |
parent | 745e419c5c2258433b492289558c52f2d33fab33 (diff) |
StandaloneTestStrategy: Make sure to create a fresh TEST_TMPDIR when running a test. Fixes #431.
--
MOS_MIGRATED_REVID=102650964
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java b/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java index ea19b5bf99..8a133151a6 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java +++ b/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java @@ -33,6 +33,7 @@ import com.google.devtools.build.lib.events.Reporter; import com.google.devtools.build.lib.util.io.FileOutErr; import com.google.devtools.build.lib.vfs.FileSystemUtils; import com.google.devtools.build.lib.vfs.Path; +import com.google.devtools.build.lib.vfs.Symlinks; import com.google.devtools.build.lib.view.test.TestStatus.BlazeTestStatus; import com.google.devtools.build.lib.view.test.TestStatus.TestCase; import com.google.devtools.build.lib.view.test.TestStatus.TestResultData; @@ -105,6 +106,9 @@ public class StandaloneTestStrategy extends TestStrategy { Executor executor = actionExecutionContext.getExecutor(); try { + if (testTmpDir.exists(Symlinks.NOFOLLOW)) { + FileSystemUtils.deleteTree(testTmpDir); + } FileSystemUtils.createDirectoryAndParents(testTmpDir); } catch (IOException e) { executor.getEventHandler().handle(Event.error("Could not create TEST_TMPDIR: " + e)); |