@Test
  public void useReplicaNotSucceededSendTest() {
    int replicaCount = 4;
    List<Port> portList = Collections.singletonList(new Port(PORT, PortType.PLAINTEXT));
    List<String> mountPaths = Collections.singletonList("mockMountPath");
    datanodes = Collections.singletonList(new MockDataNodeId(portList, mountPaths, "dc-0"));
    mockPartition = new MockPartitionId();
    populateReplicaList(replicaCount, ReplicaState.STANDBY);
    localDcName = datanodes.get(0).getDatacenterName();
    mockClusterMap = new MockClusterMap(false, datanodes, 1, Collections.singletonList(mockPartition), localDcName);
    OperationTracker ot = getOperationTrackerForGetOrPut(true, 1, 2, RouterOperation.GetBlobOperation, true);
    sendRequests(ot, 2, true);
    ot.onResponse(inflightReplicas.poll(), TrackedRequestFinalState.FAILURE);
    ot.onResponse(inflightReplicas.poll(), TrackedRequestFinalState.FAILURE);
    assertFalse("Operation should not be done", ot.isDone());
    sendRequests(ot, 1, true);
    ot.onResponse(inflightReplicas.poll(), TrackedRequestFinalState.FAILURE);
    assertFalse("Operation should not be done", ot.isDone());
    sendRequests(ot, 1, false);
    ot.onResponse(inflightReplicas.poll(), TrackedRequestFinalState.SUCCESS);
    assertTrue("Operation should have succeeded", ot.hasSucceeded());
    assertTrue("Operation should be done", ot.isDone());
  }
crossColoEnabled = true, successTarget = 1, parallelism = 2.
Only 4 local replicas

1. Get 1st local replica to send request (and sent);
2. Get 2nd local replica to send request (and failed to send);
3. Get 3rd local replica to send request (and sent);
4. Receive 2 failed responses from the 1st and 3rd replicas;
5. Get again 2nd local replica to send request (and sent);
6. Get 4th local replica to send request (and failed to send);
7. Receive 1 failed responses from the 2nd replicas;
8. Get again 4th local replica to send request (and sent);
9. Receive 1 successful response from the 4th replica;
10. Operation succeeds.
ambry-router/src/test/java/com/github/ambry/router/OperationTrackerTest.java