You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by cn...@apache.org on 2015/01/13 18:50:14 UTC

[13/50] [abbrv] hadoop git commit: HADOOP-11462. TestSocketIOWithTimeout needs change for PowerPC platform. Contributed by Ayappan.

HADOOP-11462. TestSocketIOWithTimeout needs change for PowerPC platform. Contributed by Ayappan.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/3ed0aed3
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/3ed0aed3
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/3ed0aed3

Branch: refs/heads/HDFS-6994
Commit: 3ed0aed3cc4c2c7f96d3c5dd95d8dcd4eb8e888a
Parents: fe8d2bd
Author: cnauroth <cn...@apache.org>
Authored: Wed Jan 7 12:24:10 2015 -0800
Committer: cnauroth <cn...@apache.org>
Committed: Wed Jan 7 12:24:10 2015 -0800

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt               | 3 +++
 .../java/org/apache/hadoop/net/TestSocketIOWithTimeout.java   | 7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/3ed0aed3/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 49438aa..23bd428 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -680,6 +680,9 @@ Release 2.7.0 - UNRELEASED
     HADOOP-11445. Bzip2Codec: Data block is skipped when position of newly
     created stream is equal to start of split (Ankit Kamboj via jlowe)
 
+    HADOOP-11462. TestSocketIOWithTimeout needs change for PowerPC platform.
+    (Ayappan via cnauroth)
+
 Release 2.6.0 - 2014-11-18
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/3ed0aed3/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestSocketIOWithTimeout.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestSocketIOWithTimeout.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestSocketIOWithTimeout.java
index f29fcf9..649ba12 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestSocketIOWithTimeout.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/net/TestSocketIOWithTimeout.java
@@ -33,6 +33,7 @@ import org.apache.hadoop.test.MultithreadedTestUtil.TestContext;
 import org.apache.hadoop.test.MultithreadedTestUtil.TestingThread;
 import org.apache.hadoop.util.Time;
 import org.apache.hadoop.util.Shell;
+import org.apache.hadoop.io.nativeio.NativeIO;
 
 import org.junit.Test;
 import static org.junit.Assert.*;
@@ -53,12 +54,14 @@ public class TestSocketIOWithTimeout {
 
   private MultithreadedTestUtil.TestContext ctx = new TestContext();
   
+  private static final int PAGE_SIZE = (int) NativeIO.POSIX.getCacheManipulator().getOperatingSystemPageSize();
+
   private void doIO(InputStream in, OutputStream out,
       int expectedTimeout) throws IOException {
     /* Keep on writing or reading until we get SocketTimeoutException.
      * It expects this exception to occur within 100 millis of TIMEOUT.
      */
-    byte buf[] = new byte[4192];
+    byte buf[] = new byte[PAGE_SIZE + 19];
     
     while (true) {
       long start = Time.now();
@@ -151,7 +154,7 @@ public class TestSocketIOWithTimeout {
       // simulate a partial write scenario.  Attempts were made to switch the
       // test from using a pipe to a network socket and also to use larger and
       // larger buffers in doIO.  Nothing helped the situation though.
-      if (!Shell.WINDOWS && !Shell.PPC_64) {
+      if (!Shell.WINDOWS) {
         try {
           out.write(1);
           fail("Did not throw");