From 4b216ca643092504a490f74dd78fb7d121b1c901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20G=C3=B6rler?= Date: Wed, 16 Jul 2014 18:06:52 +0200 Subject: [PATCH] Fix detection of symlinks in acceptance tests Delete of temporary files failed if the tmp folder in which the temporary directory was created is a symlink. Now, the temporary folder is canonicalized before it is used. This fixes this issue. Change-Id: Ic5aa91e5242b5b836131c11b05b8723c50b359d9 --- .../test/java/com/google/gerrit/acceptance/TempFileUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/TempFileUtil.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/TempFileUtil.java index fb44d83db8..0b78f5717c 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/TempFileUtil.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/TempFileUtil.java @@ -23,7 +23,7 @@ public class TempFileUtil { private static List allDirsCreated = new ArrayList<>(); public synchronized static File createTempDirectory() throws IOException { - File tmp = File.createTempFile("gerrit_test_", ""); + File tmp = File.createTempFile("gerrit_test_", "").getCanonicalFile(); if (!tmp.delete() || !tmp.mkdir()) { throw new IOException("Cannot create " + tmp.getPath()); }