HADOOP-8982. Merge 1490124 from trunk

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1490125 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Suresh Srinivas 2013-06-06 04:18:13 +00:00
parent 29cd270f43
commit 86e07b9f66
2 changed files with 18 additions and 6 deletions

View File

@ -426,6 +426,9 @@ Release 2.1.0-beta - UNRELEASED
HADOOP-9526. TestShellCommandFencer and TestShell fail on Windows.
(Arpit Agarwal via suresh)
HADOOP-8982. TestSocketIOWithTimeout fails on Windows.
(Chris Nauroth via suresh)
Release 2.0.5-alpha - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -32,6 +32,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.junit.Test;
import static org.junit.Assert.*;
@ -144,6 +145,13 @@ public void doWork() throws Exception {
// Nevertheless, the output stream is closed, because
// a partial write may have succeeded (see comment in
// SocketOutputStream#write(byte[]), int, int)
// This portion of the test cannot pass on Windows due to differences in
// behavior of partial writes. Windows appears to buffer large amounts of
// written data and send it all atomically, thus making it impossible to
// 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) {
try {
out.write(1);
fail("Did not throw");
@ -151,6 +159,7 @@ public void doWork() throws Exception {
GenericTestUtils.assertExceptionContains(
"stream is closed", ioe);
}
}
out.close();
assertFalse(sink.isOpen());