@Test
  public void testFailureOnAllPollThatSends() throws Exception {
    router = getNonBlockingRouter();
    setOperationParams(CHUNK_SIZE, new GetBlobOptionsBuilder().build());
    String blobId =
        router.putBlob(putBlobProperties, putUserMetadata, putChannel, new PutBlobOptionsBuilder().build()).get();
    mockSelectorState.set(MockSelectorState.ThrowExceptionOnSend);
    Future future;
    try {
      future = router.getBlob(blobId,
          new GetBlobOptionsBuilder().operationType(GetBlobOptions.OperationType.BlobInfo).build());
      while (!future.isDone()) {
        mockTime.sleep(routerConfig.routerRequestTimeoutMs + 1);
        Thread.yield();
      }
      future.get();
      Assert.fail("operation should have thrown");
    } catch (ExecutionException e) {
      RouterException routerException = (RouterException) e.getCause();
      Assert.assertEquals(RouterErrorCode.OperationTimedOut, routerException.getErrorCode());
    }

    try {
      future = router.getBlob(blobId, options);
      while (!future.isDone()) {
        mockTime.sleep(routerConfig.routerRequestTimeoutMs + 1);
        Thread.yield();
      }
      future.get();
      Assert.fail("operation should have thrown");
    } catch (ExecutionException e) {
      RouterException routerException = (RouterException) e.getCause();
      Assert.assertEquals(RouterErrorCode.OperationTimedOut, routerException.getErrorCode());
    }
    router.close();
  }
Tests the failure case where poll throws and closes the router. This also tests the case where the GetManager
gets closed with active operations, and ensures that operations get completed with the appropriate error.
@throws Exception
ambry-router/src/test/java/com/github/ambry/router/GetManagerTest.java