HBASE-12541 Add misc debug logging to hanging tests in TestHCM and TestBaseLoadBalancer

This commit is contained in:
stack 2014-11-20 17:54:39 -08:00
parent 49422a9ec4
commit bfda57d4f2
3 changed files with 16 additions and 12 deletions

View File

@ -1006,7 +1006,7 @@ public class TestHCM {
return prevNumRetriesVal;
}
@Test
@Test (timeout=30000)
public void testMulti() throws Exception {
HTable table = TEST_UTIL.createTable(TABLE_NAME3, FAM_NAM);
TEST_UTIL.createMultiRegions(table, FAM_NAM);
@ -1023,9 +1023,7 @@ public class TestHCM {
HMaster master = TEST_UTIL.getMiniHBaseCluster().getMaster();
// We can wait for all regions to be online, that makes log reading easier when debugging
while (master.getAssignmentManager().getRegionStates().isRegionsInTransition()) {
Thread.sleep(1);
}
TEST_UTIL.waitUntilNoRegionsInTransition(20000);
Put put = new Put(ROW_X);
put.add(FAM_NAM, ROW_X, ROW_X);
@ -1033,6 +1031,12 @@ public class TestHCM {
// Now moving the region to the second server
HRegionLocation toMove = conn.getCachedLocation(TABLE_NAME3, ROW_X).getRegionLocation();
if (toMove == null) {
String msg = "Failed to find location for " + Bytes.toString(ROW_X) + " in " + TABLE_NAME3;
// Log so easier to see in output where error occurred.
LOG.error(msg);
throw new NullPointerException(msg);
}
byte[] regionName = toMove.getRegionInfo().getRegionName();
byte[] encodedRegionNameBytes = toMove.getRegionInfo().getEncodedNameAsBytes();

View File

@ -329,7 +329,6 @@ public class TestMultiParallel {
public void testBatchWithPut() throws Exception {
LOG.info("test=testBatchWithPut");
Table table = new HTable(UTIL.getConfiguration(), TEST_TABLE);
// put multiple rows using a batch
List<Row> puts = constructPutRequests();
@ -675,6 +674,7 @@ public class TestMultiParallel {
private void validateLoadedData(Table table) throws IOException {
// get the data back and validate that it is correct
LOG.info("Validating data on " + table);
for (byte[] k : KEYS) {
Get get = new Get(k);
get.addColumn(BYTES_FAMILY, QUALIFIER);

View File

@ -112,7 +112,7 @@ public class TestBaseLoadBalancer extends BalancerTestBase {
*
* @throws Exception
*/
@Test
@Test (timeout=30000)
public void testImmediateAssignment() throws Exception {
for (int[] mock : regionsAndServersMocks) {
LOG.debug("testImmediateAssignment with " + mock[0] + " regions and " + mock[1] + " servers");
@ -147,7 +147,7 @@ public class TestBaseLoadBalancer extends BalancerTestBase {
*
* @throws Exception
*/
@Test
@Test (timeout=180000)
public void testBulkAssignment() throws Exception {
for (int[] mock : regionsAndServersMocks) {
LOG.debug("testBulkAssignment with " + mock[0] + " regions and " + mock[1] + " servers");
@ -174,7 +174,7 @@ public class TestBaseLoadBalancer extends BalancerTestBase {
* assignment info.
* @throws Exception
*/
@Test
@Test (timeout=180000)
public void testRetainAssignment() throws Exception {
// Test simple case where all same servers are there
List<ServerAndLoad> servers = randomServers(10, 10);
@ -210,7 +210,7 @@ public class TestBaseLoadBalancer extends BalancerTestBase {
assertRetainedAssignment(existing, listOfServerNames, assignment);
}
@Test
@Test (timeout=180000)
public void testRegionAvailability() throws Exception {
// Create a cluster with a few servers, assign them to specific racks
// then assign some regions. The tests should check whether moving a
@ -284,7 +284,7 @@ public class TestBaseLoadBalancer extends BalancerTestBase {
assertTrue(!cluster.wouldLowerAvailability(hri1, servers[6]));
}
@Test
@Test (timeout=180000)
public void testRegionAvailabilityWithRegionMoves() throws Exception {
List<HRegionInfo> list0 = new ArrayList<HRegionInfo>();
List<HRegionInfo> list1 = new ArrayList<HRegionInfo>();
@ -396,7 +396,7 @@ public class TestBaseLoadBalancer extends BalancerTestBase {
}
}
@Test
@Test (timeout=180000)
public void testClusterServersWithSameHostPort() {
// tests whether the BaseLoadBalancer.Cluster can be constructed with servers
// sharing same host and port
@ -436,7 +436,7 @@ public class TestBaseLoadBalancer extends BalancerTestBase {
}
}
@Test
@Test (timeout=180000)
public void testClusterRegionLocations() {
// tests whether region locations are handled correctly in Cluster
List<ServerName> servers = getListOfServerNames(randomServers(10, 10));