@Test
  public void localDcDiskOriginatingDcDiskTest() {
    initializeWithCloudDcs(false);
    // test failure in disk dc with fallback to disk DC
    originatingDcName = getDatacenters(ReplicaType.DISK_BACKED, localDcName).iterator().next();
    OperationTracker ot = getOperationTrackerForGetOrPut(true, 2, 3, RouterOperation.GetBlobOperation, true);
    assertFalse("Operation should not have been done.", ot.isDone());
    // parallelism of 3 for disk replicas (local dc).
    sendRequests(ot, 3, false);
    assertFalse("Operation should not have been done.", ot.isDone());
    for (int i = 0; i < 3; i++) {
      ot.onResponse(inflightReplicas.poll(), TrackedRequestFinalState.FAILURE);
      // parallelism should still be 3 after disk request returned a failure
      sendRequests(ot, 1, false);
    }
    assertFalse("Operation should not have been done.", ot.isDone());
    ot.onResponse(inflightReplicas.poll(), TrackedRequestFinalState.SUCCESS);
    ot.onResponse(inflightReplicas.poll(), TrackedRequestFinalState.SUCCESS);
    assertTrue("Operation should have succeeded", ot.hasSucceeded());
    assertTrue("Operation should be done", ot.isDone());
    ot.onResponse(inflightReplicas.poll(), TrackedRequestFinalState.FAILURE);
    assertTrue("Operation should have succeeded", ot.hasSucceeded());
    assertTrue("Operation should be done", ot.isDone());

    // test failure in all disk DCs, fall back to non originating cloud DCs, fail there too
    repetitionTracker.clear();
    ot = getOperationTrackerForGetOrPut(true, 2, 3, RouterOperation.GetBlobOperation, true);
    sendRequests(ot, 3, false);
    for (int i = 0; i < 3; i++) {
      ot.onResponse(inflightReplicas.poll(), TrackedRequestFinalState.FAILURE);
    }
    assertFalse("Operation should not have been done.", ot.isDone());
    sendRequests(ot, 3, false);
    for (int i = 0; i < 3; i++) {
      ot.onResponse(inflightReplicas.poll(), TrackedRequestFinalState.FAILURE);
    }
    assertFalse("Operation should not have been done.", ot.isDone());
  }
Test cases with disk replicas in the local datacenter and disk replicas in the originating datacenter. This helps
to ensure that there are no regressions when cloud replicas are added to the clustermap.
ambry-router/src/test/java/com/github/ambry/router/OperationTrackerTest.java