HBASE-9366 TestHTraceHooks.testTraceCreateTable errors out sometimes.

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1523816 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
eclark 2013-09-16 21:22:34 +00:00
parent 10eec81e09
commit 14f8d46f2f
1 changed files with 10 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import java.util.Collection;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.MediumTests;
import org.apache.hadoop.hbase.Waiter;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.cloudera.htrace.Sampler;
@ -71,6 +72,15 @@ public class TestHTraceHooks {
tableCreationSpan.close();
}
// Some table creation is async. Need to make sure that everything is full in before
// checking to see if the spans are there.
TEST_UTIL.waitFor(1000, new Waiter.Predicate<Exception>() {
@Override
public boolean evaluate() throws Exception {
return rcvr.getSpans().size() >= 5;
}
});
Collection<Span> spans = rcvr.getSpans();
TraceTree traceTree = new TraceTree(spans);
Collection<Span> roots = traceTree.getRoots();