@Test
  public void testNetworkRequestTimeoutAllFailure() throws Exception {
    doPut();
    GetBlobOperation op = createOperation(routerConfig, null);
    op.poll(requestRegistrationCallback);
    int count = 0;
    while (!op.isOperationComplete()) {
      for (RequestInfo requestInfo : requestRegistrationCallback.getRequestsToSend()) {
        requestInfo.setRequestEnqueueTime(time.milliseconds());
      }
      time.sleep(routerConfig.routerRequestNetworkTimeoutMs + 1);
      op.poll(requestRegistrationCallback);
      count++;
    }

    Assert.assertEquals("Mismatch in expected number of polls",
        (int) Math.ceil((double) replicasCount / routerConfig.routerGetRequestParallelism), count);
    // At this time requests would have been created for all replicas, as none of them were delivered,
    // and cross-colo proxying is enabled by default.
    Assert.assertEquals("Must have attempted sending requests to all replicas", replicasCount,
        correlationIdToGetOperation.size());
    assertFailureAndCheckErrorCode(op, RouterErrorCode.OperationTimedOut);

    // test that timed out response won't update latency histogram if exclude timeout is enabled.
    assumeTrue(operationTrackerType.equals(AdaptiveOperationTracker.class.getSimpleName()));
    AdaptiveOperationTracker tracker = (AdaptiveOperationTracker) op.getFirstChunkOperationTrackerInUse();
    Histogram localColoTracker =
        tracker.getLatencyHistogram(RouterTestHelpers.getAnyReplica(blobId, true, localDcName));
    Histogram crossColoTracker =
        tracker.getLatencyHistogram(RouterTestHelpers.getAnyReplica(blobId, false, localDcName));
    Assert.assertEquals("Timed-out response shouldn't be counted into local colo latency histogram", 0,
        localColoTracker.getCount());
    Assert.assertEquals("Timed-out response shouldn't be counted into cross colo latency histogram", 0,
        crossColoTracker.getCount());
  }
Test the case where all requests time out at network layer within the GetOperation.
@throws Exception
ambry-router/src/test/java/com/github/ambry/router/GetBlobOperationTest.java