HBASE-19986 If HBaseTestClassRule timesout a test, thread dump
This commit is contained in:
parent
1ae64ccee0
commit
e94f082776
|
@ -1,4 +1,4 @@
|
||||||
/**
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
* distributed with this work for additional information
|
* distributed with this work for additional information
|
||||||
|
@ -18,6 +18,7 @@
|
||||||
package org.apache.hadoop.hbase;
|
package org.apache.hadoop.hbase;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.apache.hadoop.hbase.testclassification.LargeTests;
|
import org.apache.hadoop.hbase.testclassification.LargeTests;
|
||||||
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
import org.apache.hadoop.hbase.testclassification.MediumTests;
|
||||||
import org.apache.hadoop.hbase.testclassification.SmallTests;
|
import org.apache.hadoop.hbase.testclassification.SmallTests;
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
package org.apache.hadoop.hbase;
|
package org.apache.hadoop.hbase;
|
||||||
|
|
||||||
import org.apache.hadoop.hbase.testclassification.SmallTests;
|
import org.apache.hadoop.hbase.testclassification.SmallTests;
|
||||||
|
import org.apache.hadoop.hbase.util.Threads;
|
||||||
import org.junit.ClassRule;
|
import org.junit.ClassRule;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -41,6 +42,18 @@ public class TestTimeout {
|
||||||
*/
|
*/
|
||||||
@Ignore @Test
|
@Ignore @Test
|
||||||
public void infiniteLoop() {
|
public void infiniteLoop() {
|
||||||
while (true) {}
|
// Launch a background non-daemon thread.
|
||||||
|
Thread t = new Thread("HangingThread") {
|
||||||
|
public void run() {
|
||||||
|
synchronized(this) {
|
||||||
|
while(true) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
t.start();
|
||||||
|
while (true) {
|
||||||
|
// Just hang out too.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ public class TimedOutTestsListener extends RunListener {
|
||||||
output.println();
|
output.println();
|
||||||
output.print(buildThreadDiagnosticString());
|
output.print(buildThreadDiagnosticString());
|
||||||
}
|
}
|
||||||
|
output.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String buildThreadDiagnosticString() {
|
public static String buildThreadDiagnosticString() {
|
2
pom.xml
2
pom.xml
|
@ -614,7 +614,7 @@
|
||||||
<properties>
|
<properties>
|
||||||
<property>
|
<property>
|
||||||
<name>listener</name>
|
<name>listener</name>
|
||||||
<value>org.apache.hadoop.hbase.HBaseClassTestRuleChecker,org.apache.hadoop.hbase.ResourceCheckerJUnitListener</value>
|
<value>org.apache.hadoop.hbase.TimedOutTestsListener,org.apache.hadoop.hbase.HBaseClassTestRuleChecker,org.apache.hadoop.hbase.ResourceCheckerJUnitListener</value>
|
||||||
</property>
|
</property>
|
||||||
</properties>
|
</properties>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
Loading…
Reference in New Issue