From 4a77729a1cc42822836519cd6048538aec9ea1b1 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. (cherry picked from commit b6fd5ccbce25f390c0e348d296b4fe1f8b9b738f) --- 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 a2ffc594dd5..b7c22c31f83 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -572,6 +572,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 af28ed70652..d5531db8e1e 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.CacheManipulator; 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 @@ public class TestFsDatasetCacheRevocation { */ @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 class TestFsDatasetCacheRevocation { */ @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 7fe8a1eab1e..800cc6bb820 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.hdfs.MiniDFSCluster; 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 class TestTracingShortCircuitLocalRead { @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());