From: Julien HENRY Date: Mon, 24 Mar 2014 11:13:25 +0000 (+0100) Subject: SONAR-5062 Improve stability of tests X-Git-Tag: 4.3~305 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2a3aba9720dd5c2afa717ec30b479402c1058c59;p=sonarqube.git SONAR-5062 Improve stability of tests --- diff --git a/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java b/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java index 085e83b0f4b..a02eefc6d3e 100644 --- a/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java +++ b/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java @@ -189,7 +189,10 @@ public class FileCache { File tempDir = createTempDir(); ZipUtils.unzip(cachedFile, tempDir, new LibFilter()); try { - FileUtils.moveDirectory(tempDir, destDir); + // Recheck in case of concurrent processes + if (!destDir.exists()) { + FileUtils.moveDirectory(tempDir, destDir); + } } catch (FileExistsException e) { // Ignore as is certainly means a concurrent process has unziped the same file }