From b6fd5ccbce25f390c0e348d296b4fe1f8b9b738f Mon Sep 17 00:00:00 2001 From: cnauroth Date: Sun, 21 Sep 2014 12:36:57 -0700 Subject: [PATCH] HDFS-7110. Skip tests related to short-circuit read on platforms that do not currently implement short-circuit read. Contributed by Chris Nauroth. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hdfs/server/datanode/TestFsDatasetCacheRevocation.java | 5 +++++ .../hadoop/tracing/TestTracingShortCircuitLocalRead.java | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 5a69d9d4c3..f29f7c5faf 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -911,6 +911,9 @@ Release 2.6.0 - UNRELEASED HDFS-7109. TestDataStorage does not release file locks between tests. (cnauroth) + HDFS-7110. Skip tests related to short-circuit read on platforms that do not + currently implement short-circuit read. (cnauroth) + Release 2.5.1 - 2014-09-05 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestFsDatasetCacheRevocation.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestFsDatasetCacheRevocation.java index af28ed7065..d5531db8e1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestFsDatasetCacheRevocation.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestFsDatasetCacheRevocation.java @@ -17,6 +17,8 @@ */ package org.apache.hadoop.hdfs.server.datanode; +import static org.junit.Assume.assumeTrue; + import java.io.File; import java.nio.ByteBuffer; import java.util.EnumSet; @@ -41,6 +43,7 @@ import org.apache.hadoop.io.nativeio.NativeIO.POSIX.NoMlockCacheManipulator; import org.apache.hadoop.net.unix.DomainSocket; import org.apache.hadoop.net.unix.TemporarySocketDirectory; +import org.apache.hadoop.util.NativeCodeLoader; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -94,6 +97,7 @@ private static Configuration getDefaultConf() { */ @Test(timeout=120000) public void testPinning() throws Exception { + assumeTrue(NativeCodeLoader.isNativeCodeLoaded() && !Path.WINDOWS); Configuration conf = getDefaultConf(); // Set a really long revocation timeout, so that we won't reach it during // this test. @@ -143,6 +147,7 @@ public void testPinning() throws Exception { */ @Test(timeout=120000) public void testRevocation() throws Exception { + assumeTrue(NativeCodeLoader.isNativeCodeLoaded() && !Path.WINDOWS); BlockReaderTestUtil.enableHdfsCachingTracing(); BlockReaderTestUtil.enableShortCircuitShmTracing(); Configuration conf = getDefaultConf(); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTracingShortCircuitLocalRead.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTracingShortCircuitLocalRead.java index 7fe8a1eab1..800cc6bb82 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTracingShortCircuitLocalRead.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTracingShortCircuitLocalRead.java @@ -17,6 +17,8 @@ */ package org.apache.hadoop.tracing; +import static org.junit.Assume.assumeTrue; + import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.Path; @@ -27,6 +29,7 @@ import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.net.unix.DomainSocket; import org.apache.hadoop.net.unix.TemporarySocketDirectory; +import org.apache.hadoop.util.NativeCodeLoader; import org.htrace.Sampler; import org.htrace.Span; import org.htrace.Trace; @@ -59,6 +62,7 @@ public static void shutdown() throws IOException { @Test public void testShortCircuitTraceHooks() throws IOException { + assumeTrue(NativeCodeLoader.isNativeCodeLoaded() && !Path.WINDOWS); conf = new Configuration(); conf.set(SpanReceiverHost.SPAN_RECEIVERS_CONF_KEY, TestTracing.SetSpanReceiver.class.getName());