@TestOnly
  void waitForAllFlushed() {
    while (true) {
      synchronized (myLock) {
        if (myPendingChunks.isEmpty()) {
          return;
        }
        if (myAlarm.isEmpty()) {
          throw new RuntimeException("No requests scheduled");
        }
      }
      try {
        myAlarm.waitForAllExecuted(10, TimeUnit.SECONDS);
      }
      catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
  }
@TestOnly
  void waitForAllFlushed()