List<List<Span>> setupDurationData(TestInfo testInfo) throws Exception {
    String testSuffix = testSuffix(testInfo);
    Endpoint frontend = suffixServiceName(TestObjects.FRONTEND, testSuffix);
    Endpoint backend = suffixServiceName(TestObjects.BACKEND, testSuffix);
    Endpoint db = suffixServiceName(TestObjects.DB, testSuffix);

    String traceId1 = newTraceId(), traceId2 = newTraceId(), traceId3 = newTraceId();
    long offsetMicros = (TODAY - 3) * 1000L; // to make sure queries look back properly
    Span targz = Span.newBuilder().traceId(traceId1).id(1L)
      .name("targz").timestamp(offsetMicros + 100L).duration(200_000L)
      .localEndpoint(frontend)
      .remoteEndpoint(db)
      .putTag("lc", "archiver").build();
    Span tar = Span.newBuilder().traceId(traceId1).id(2L).parentId(1L)
      .name("tar").timestamp(offsetMicros + 200L).duration(150_000L)
      .localEndpoint(backend)
      .remoteEndpoint(backend)
      .putTag("lc", "archiver").build();
    Span gz = Span.newBuilder().traceId(traceId1).id(3L).parentId(1L)
      .name("gz").timestamp(offsetMicros + 250L).duration(50_000L)
      .localEndpoint(db)
      .remoteEndpoint(frontend)
      .putTag("lc", "archiver").build();
    Span zip = Span.newBuilder().traceId(traceId3).id(3L)
      .name("zip").timestamp(offsetMicros + 130L).duration(50_000L)
      .addAnnotation(offsetMicros + 130L, "zip")
      .localEndpoint(backend)
      .remoteEndpoint(backend)
      .putTag("lc", "archiver").build();

    List<Span> trace1 = List.of(targz, tar, gz);
    List<Span> trace2 = List.of(
      targz.toBuilder().traceId(traceId2).timestamp(offsetMicros + 110L)
        .localEndpoint(db)
        .remoteEndpoint(frontend)
        .putTag("lc", "archiver-v2").build(),
      tar.toBuilder().traceId(traceId2).timestamp(offsetMicros + 210L)
        .localEndpoint(backend)
        .remoteEndpoint(backend)
        .putTag("lc", "archiver").build(),
      gz.toBuilder().traceId(traceId2).timestamp(offsetMicros + 260L)
        .localEndpoint(frontend)
        .remoteEndpoint(backend)
        .putTag("lc", "archiver").build());
    List<Span> trace3 = List.of(zip);

    accept(trace1);
    accept(trace2);
    accept(trace3);
    return List.of(trace1, trace2, trace3);
  }
Ensure complete traces are aggregated, even if they complete after endTs
zipkin-tests/src/main/java/zipkin2/storage/ITSpanStore.java