@Test(timeout=30000)
public void testCopyFromHostConnectionTimeout() throws Exception {

  when(connection.getInputStream()).thenThrow(
      new SocketTimeoutException("This is a fake timeout :)"));
  
  Fetcher<Text,Text> underTest = new FakeFetcher<Text,Text>(job, id, ss, mm,
      r, metrics, except, key, connection);
  underTest.copyFromHost(host);
  
  verify(connection).addRequestProperty(
      SecureShuffleUtils.HTTP_HEADER_URL_HASH, encHash);
  
  verify(allErrs).increment(1);
  verify(ss).copyFailed(map1ID, host, false, false);
  verify(ss).copyFailed(map2ID, host, false, false);
  
  verify(ss).putBackKnownMapOutput(any(MapHost.class), eq(map1ID));
  verify(ss).putBackKnownMapOutput(any(MapHost.class), eq(map2ID));
}