@Test
  public void testHMasterShutdown() {
    final Matcher<SpanData> masterShutdownMatcher = allOf(hasName("HMaster.shutdown"),
      hasParentSpanId(NO_PARENT_ID), hasStatusWithCode(isOneOf(StatusCode.OK, StatusCode.ERROR)));
    assertThat("there should be a span from the HMaster.shutdown.", spans,
      hasItem(masterShutdownMatcher));
    final SpanData masterShutdownSpan = spans.stream().filter(masterShutdownMatcher::matches)
      .findAny().orElseThrow(AssertionError::new);
    assertThat("the HMaster.shutdown span should show zookeeper interaction.", spans, hasItem(
      allOf(hasName(startsWith("RecoverableZookeeper.")), hasParentSpanId(masterShutdownSpan))));
    assertThat("the HMaster.shutdown span should show AsyncConnection interaction.", spans,
      hasItem(allOf(hasName(startsWith("AsyncConnection.")), hasParentSpanId(masterShutdownSpan))));
  }
Wait for the underlying cluster to come up -- defined by meta being available.
hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerInternalsTracing.java