From 8e23270e0d330e02ae6e22f17d3527136b7ccc71 Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Mon, 10 Jun 2013 22:37:36 +0000 Subject: [PATCH] HDFS-4752. TestRBWBlockInvalidation fails on Windows due to file locking. Contributed by Chris Nauroth. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1491631 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../server/blockmanagement/TestRBWBlockInvalidation.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 35362c1d52..6390499d38 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -698,6 +698,9 @@ Release 2.1.0-beta - UNRELEASED HDFS-4677. Editlog should support synchronous writes. (ivanmi) + HDFS-4752. TestRBWBlockInvalidation fails on Windows due to file locking. + (Chris Nauroth via suresh) + BREAKDOWN OF HDFS-2802 HDFS SNAPSHOT SUBTASKS AND RELATED JIRAS HDFS-4076. Support snapshot of single files. (szetszwo) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestRBWBlockInvalidation.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestRBWBlockInvalidation.java index 84c5feeb48..834842c70e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestRBWBlockInvalidation.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestRBWBlockInvalidation.java @@ -19,6 +19,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeTrue; import java.io.Closeable; import java.io.File; @@ -68,6 +69,10 @@ private static NumberReplicas countReplicas(final FSNamesystem namesystem, @Test(timeout=60000) public void testBlockInvalidationWhenRBWReplicaMissedInDN() throws IOException, InterruptedException { + // This test cannot pass on Windows due to file locking enforcement. It will + // reject the attempt to delete the block file from the RBW folder. + assumeTrue(!Path.WINDOWS); + Configuration conf = new HdfsConfiguration(); conf.setInt(DFSConfigKeys.DFS_REPLICATION_KEY, 2); conf.setLong(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 100);