diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 4bb9fa6980..c9d751b0b6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -352,6 +352,9 @@ Trunk (Unreleased) HDFS-4625. Make TestNNWithQJM#testNewNamenodeTakesOverWriter work on Windows. (Ivan Mitic via suresh) + HDFS-4674. TestBPOfferService fails on Windows due to failure parsing + datanode data directory as URI. (Chris Nauroth via suresh) + Release 2.0.5-beta - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBPOfferService.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBPOfferService.java index 504e1ca685..42ea48230e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBPOfferService.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBPOfferService.java @@ -17,10 +17,12 @@ */ package org.apache.hadoop.hdfs.server.datanode; +import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_DATA_DIR_KEY; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; +import java.io.File; import java.io.IOException; import java.net.InetSocketAddress; import java.util.Map; @@ -68,6 +70,8 @@ public class TestBPOfferService { TestBPOfferService.class); private static final ExtendedBlock FAKE_BLOCK = new ExtendedBlock(FAKE_BPID, 12345L); + private static final String TEST_BUILD_DATA = System.getProperty( + "test.build.data", "build/test/data"); static { ((Log4JLogger)DataNode.LOG).getLogger().setLevel(Level.ALL); @@ -90,6 +94,8 @@ public void setupMocks() throws Exception { mockDn = Mockito.mock(DataNode.class); Mockito.doReturn(true).when(mockDn).shouldRun(); Configuration conf = new Configuration(); + File dnDataDir = new File(new File(TEST_BUILD_DATA, "dfs"), "data"); + conf.set(DFS_DATANODE_DATA_DIR_KEY, dnDataDir.toURI().toString()); Mockito.doReturn(conf).when(mockDn).getConf(); Mockito.doReturn(new DNConf(conf)).when(mockDn).getDnConf(); Mockito.doReturn(DataNodeMetrics.create(conf, "fake dn"))