@Test
  public void testHRegionServerRegisterWithMaster() {
    final Matcher<SpanData> rsRegisterWithMasterMatcher =
      allOf(hasName("HRegionServer.registerWithMaster"), hasParentSpanId(NO_PARENT_ID),
        hasStatusWithCode(isOneOf(StatusCode.OK, StatusCode.ERROR)));
    assertThat("there should be a span from the HRegionServer registerWithMaster.", spans,
      hasItem(rsRegisterWithMasterMatcher));
    final SpanData rsRegisterWithMasterSpan = spans.stream()
      .filter(rsRegisterWithMasterMatcher::matches).findAny().orElseThrow(AssertionError::new);
    assertThat("the HRegionServer registerWithMaster span should show zookeeper interaction.",
      spans, hasItem(allOf(hasName(startsWith("RecoverableZookeeper.")),
        hasParentSpanId(rsRegisterWithMasterSpan))));
    assertThat(
      "the HRegionServer registerWithMaster span should have an invocation of the"
        + " RegionServerStartup RPC.",
      spans, hasItem(allOf(hasName(endsWith("RegionServerStatusService/RegionServerStartup")),
        hasParentSpanId(rsRegisterWithMasterSpan))));
  }
Wait for the underlying cluster to come up -- defined by meta being available.
hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerInternalsTracing.java