@Test(timeout = TEST_TIMEOUT)
    public void interruptCausedBySomethingOtherThanTimer_PropagatesInterruptToCaller() {
        final int socketTimeoutInMillis = 100;
        httpClient = new AmazonHttpClient(new ClientConfiguration().withSocketTimeout(socketTimeoutInMillis)
                .withClientExecutionTimeout(CLIENT_EXECUTION_TIMEOUT)
                .withRetryPolicy(new RetryPolicy(PredefinedRetryPolicies.DEFAULT_RETRY_CONDITION,
                        new FixedTimeBackoffStrategy(CLIENT_EXECUTION_TIMEOUT), 1, false)));

        // We make sure the first connection has failed due to the socket timeout before
        // interrupting so we know that we are sleeping per the backoff strategy. Apache HTTP
        // client doesn't seem to honor interrupts reliably but Thread.sleep does
        interruptCurrentThreadAfterDelay(socketTimeoutInMillis * 2);

        try {
            httpClient.requestExecutionBuilder().request(newGetRequest()).execute();
            fail("Exception expected");
        } catch (AmazonClientException e) {
            assertTrue(Thread.currentThread().isInterrupted());
            assertThat(e.getCause(), instanceOf(InterruptedException.class));
        }
    }
The client execution timer uses interrupts to abort the client but if another thread
interrupts the current thread for another reason we don't want to squash the
{@link InterruptedException}. We should set the thread's interrupted status and throw the
exception back out (we can't throw the actual {@link InterruptedException} because it's
checked)
aws-java-sdk-core/src/test/java/com/amazonaws/http/timers/client/UnresponsiveServerIntegrationTests.java