@Test
  public void testZKWatcherRegionServer() {
    final Matcher<SpanData> rsZKWatcherMatcher =
      allOf(hasName(startsWith("ZKWatcher-regionserver")), hasParentSpanId(NO_PARENT_ID),
        hasStatusWithCode(isOneOf(StatusCode.OK, StatusCode.ERROR)));
    assertThat("there should be a span from the ZKWatcher running in the HRegionServer.", spans,
      hasItem(rsZKWatcherMatcher));
    final SpanData rsZKWatcherSpan =
      spans.stream().filter(rsZKWatcherMatcher::matches).findAny().orElseThrow(AssertionError::new);
    assertThat("the ZKWatcher running in the HRegionServer span should invoke processEvent.", spans,
      hasItem(allOf(hasName(containsString("processEvent")), hasParentSpanId(rsZKWatcherSpan))));
  }
Wait for the underlying cluster to come up -- defined by meta being available.
hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerInternalsTracing.java