@Test
  public void testTimeoutAndBlobNotFoundLocalTimeout() throws Exception {
    assumeTrue(operationTrackerType.equals(AdaptiveOperationTracker.class.getSimpleName()));
    correlationIdToGetOperation.clear();
    for (MockServer server : mockServerLayout.getMockServers()) {
      if (!server.getDataCenter().equals(localDcName)) {
        server.setServerErrorForAllRequests(ServerErrorCode.BlobNotFound);
      }
    }
    router.currentOperationsCount.incrementAndGet();
    GetBlobInfoOperation op =
        new GetBlobInfoOperation(routerConfig, routerMetrics, mockClusterMap, responseHandler, blobId, options, null,
            routerCallback, kms, cryptoService, cryptoJobHandler, time, false, quotaChargeCallback, router);
    requestRegistrationCallback.setRequestsToSend(new ArrayList<>());
    AdaptiveOperationTracker tracker = (AdaptiveOperationTracker) op.getOperationTrackerInUse();

    op.poll(requestRegistrationCallback);
    Assert.assertEquals("There should only be as many requests at this point as requestParallelism", requestParallelism,
        correlationIdToGetOperation.size());
    int count = 0;
    while (!op.isOperationComplete()) {
      time.sleep(routerConfig.routerRequestTimeoutMs + 1);
      op.poll(requestRegistrationCallback);
      if (++count == 2) {
        // exit loop to let remote replicas complete the response.
        break;
      }
    }
    // 2 + 2 requests have been sent out and all of them timed out. Nest, complete operation on remaining replicas
    completeOp(op);
    RouterException routerException = (RouterException) op.getOperationException();
    // error code should be OperationTimedOut because it precedes BlobDoesNotExist
    Assert.assertEquals(RouterErrorCode.OperationTimedOut, routerException.getErrorCode());
    Assert.assertEquals("The number of data points in local colo latency histogram is not expected", 0,
        tracker.getLatencyHistogram(localReplica).getCount());
    // the count of data points in Histogram should be 5 because 9(total replicas) - 4(# of timed out request) = 5
    Assert.assertEquals("The number of data points in cross colo latency histogram is not expected", 5,
        tracker.getLatencyHistogram(remoteReplica).getCount());
  }
Test the case where all local replicas and one remote replica timed out. The rest remote replicas respond
with Blob_Not_Found.
@throws Exception
ambry-router/src/test/java/com/github/ambry/router/GetBlobInfoOperationTest.java