From 8c19d0bb7a38678cd4ca1b0757f75b737702b1e9 Mon Sep 17 00:00:00 2001 From: Alejandro Abdelnur Date: Thu, 10 Apr 2014 17:31:32 +0000 Subject: [PATCH] HADOOP-10488. TestKeyProviderFactory fails randomly. (tucu) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1586382 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 2 ++ .../hadoop/crypto/key/TestKeyProviderFactory.java | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index eb0c76315c8..034ace7244b 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -312,6 +312,8 @@ Trunk (Unreleased) HADOOP-10044 Improve the javadoc of rpc code (sanjay Radia) + HADOOP-10488. TestKeyProviderFactory fails randomly. (tucu) + OPTIMIZATIONS HADOOP-7761. Improve the performance of raw comparisons. (todd) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/key/TestKeyProviderFactory.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/key/TestKeyProviderFactory.java index 5bede60188d..89c5aeb2f1a 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/key/TestKeyProviderFactory.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/key/TestKeyProviderFactory.java @@ -21,6 +21,8 @@ import java.io.File; import java.io.IOException; import java.net.URI; import java.util.List; +import java.util.UUID; + import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.crypto.key.KeyProvider.KeyVersion; import org.apache.hadoop.fs.FileStatus; @@ -31,6 +33,7 @@ import org.apache.hadoop.io.Text; import org.apache.hadoop.security.Credentials; import org.apache.hadoop.security.UserGroupInformation; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertArrayEquals; @@ -39,8 +42,14 @@ import static org.junit.Assert.assertTrue; public class TestKeyProviderFactory { - private static final File tmpDir = - new File(System.getProperty("test.build.data", "/tmp"), "key"); + private static File tmpDir; + + @Before + public void setup() { + tmpDir = new File(System.getProperty("test.build.data", "target"), + UUID.randomUUID().toString()); + tmpDir.mkdirs(); + } @Test public void testFactory() throws Exception {