HDFS-6694. TestPipelinesFailover.testPipelineRecoveryStress tests fail intermittently with various symptoms - debugging patch (Contributed by Yongjun Zhang)

(cherry picked from commit c5d9a4a91e)

Conflicts:
	hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
This commit is contained in:
arp 2014-08-27 09:52:33 -07:00 committed by Yongjun Zhang
parent 4257991257
commit 566ceac1ff
1 changed files with 28 additions and 0 deletions

View File

@ -55,6 +55,7 @@ import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.test.GenericTestUtils.DelayAnswer;
import org.apache.hadoop.test.MultithreadedTestUtil.RepeatingTestThread;
import org.apache.hadoop.test.MultithreadedTestUtil.TestContext;
import org.apache.hadoop.util.Shell.ShellCommandExecutor;
import org.apache.log4j.Level;
import org.junit.Test;
import org.mockito.Mockito;
@ -414,6 +415,33 @@ public class TestPipelinesFailover {
*/
@Test(timeout=STRESS_RUNTIME*3)
public void testPipelineRecoveryStress() throws Exception {
// The following section of code is to help debug HDFS-6694 about
// this test that fails from time to time due to "too many open files".
//
String[] scmd = new String[] {"/bin/sh", "-c", "ulimit -a"};
ShellCommandExecutor sce = new ShellCommandExecutor(scmd);
sce.execute();
System.out.println("HDFS-6694 Debug Data BEGIN===");
System.out.println("'ulimit -a' output:\n" + sce.getOutput());
scmd = new String[] {"hostname"};
sce = new ShellCommandExecutor(scmd);
sce.execute();
System.out.println("'hostname' output:\n" + sce.getOutput());
scmd = new String[] {"ifconfig"};
sce = new ShellCommandExecutor(scmd);
sce.execute();
System.out.println("'ifconfig' output:\n" + sce.getOutput());
scmd = new String[] {"whoami"};
sce = new ShellCommandExecutor(scmd);
sce.execute();
System.out.println("'whoami' output:\n" + sce.getOutput());
System.out.println("===HDFS-6694 Debug Data END");
HAStressTestHarness harness = new HAStressTestHarness();
// Disable permissions so that another user can recover the lease.
harness.conf.setBoolean(