From 58e191f0c5b4cebd806e40ba8da5f21c89c718f8 Mon Sep 17 00:00:00 2001 From: Aaron Myers Date: Thu, 16 May 2013 08:11:23 +0000 Subject: [PATCH] HDFS-4787. Create a new HdfsConfiguration before each TestDFSClientRetries testcases. Contributed by Tian Hong Wang. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1483235 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../java/org/apache/hadoop/hdfs/TestDFSClientRetries.java | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index f0039a37e8..065a0465fc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -945,6 +945,9 @@ Release 2.0.5-beta - UNRELEASED HDFS-3180. Add socket timeouts to WebHdfsFileSystem. (Chris Nauroth via szetszwo) + HDFS-4787. Create a new HdfsConfiguration before each TestDFSClientRetries + testcases. (Tian Hong Wang via atm) + BREAKDOWN OF HDFS-347 SUBTASKS AND RELATED JIRAS HDFS-4353. Encapsulate connections to peers in Peer and PeerServer classes. diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java index 277edef0df..89c08966b1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java @@ -90,6 +90,7 @@ import org.apache.log4j.Level; import org.junit.Assert; import org.junit.Test; +import org.junit.Before; import org.mockito.Mockito; import org.mockito.internal.stubbing.answers.ThrowsException; import org.mockito.invocation.InvocationOnMock; @@ -107,7 +108,7 @@ public class TestDFSClientRetries { final static private int MIN_SLEEP_TIME = 1000; public static final Log LOG = LogFactory.getLog(TestDFSClientRetries.class.getName()); - final static private Configuration conf = new HdfsConfiguration(); + static private Configuration conf = null; private static class TestServer extends Server { private boolean sleep; @@ -157,6 +158,11 @@ private static void writeData(OutputStream out, int len) throws IOException { } } + @Before + public void setupConf(){ + conf = new HdfsConfiguration(); + } + /** * This makes sure that when DN closes clients socket after client had * successfully connected earlier, the data can still be fetched.