@Test
  public void noUnexpiredRequestsTest() throws InterruptedException {
    primeTracker(localColoTracker, MIN_DATA_POINTS_REQUIRED, LOCAL_COLO_LATENCY_RANGE);
    primeTracker(crossColoTracker, MIN_DATA_POINTS_REQUIRED, CROSS_COLO_LATENCY_RANGE);
    double localColoCutoff = localColoTracker.getSnapshot().getValue(QUANTILE);

    OperationTracker ot = getOperationTracker(createRouterConfig(false, 1, 1, 6, null, true), mockPartition);
    // 3-0-0-0
    sendRequests(ot, 1);
    // 2-1-0-0
    // sleep for a time greater than cutoff
    time.sleep((long) localColoCutoff + 2);
    sendRequests(ot, 1);
    // 1-2-0-0
    // provide a response to the second request that is not a success
    ot.onResponse(partitionAndInflightReplicas.get(mockPartition).pollLast(), TrackedRequestFinalState.FAILURE);
    // 1-1-0-1
    assertFalse("Operation should not be done", ot.isDone());
    // should now be able to send one more request
    sendRequests(ot, 1);
    // 0-2-0-1
    ot.onResponse(partitionAndInflightReplicas.get(mockPartition).pollLast(), TrackedRequestFinalState.SUCCESS);
    // 0-1-1-1
    assertTrue("Operation should have succeeded", ot.hasSucceeded());
    // past due counter should be 1
    assertEquals("Past due counter is inconsistent", 1, pastDueCounter.getCount());
  }
Tests the case where there are no unexpired requests because the only unexpired request returned a failure. In
that case, the tracker must allow sending more requests.
@throws InterruptedException
ambry-router/src/test/java/com/github/ambry/router/AdaptiveOperationTrackerTest.java