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 b6fd5ccbce)
This commit is contained in:
cnauroth 2014-09-21 12:36:57 -07:00
parent 465ba7fe31
commit 4a77729a1c
3 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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();

View File

@ -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());