Search in sources :

Example 1 with ImagePushFailedException

use of com.spotify.docker.client.exceptions.ImagePushFailedException in project docker-client by spotify.

the class DefaultDockerClientTest method testFailedPushDoesNotLeakConn.

@SuppressWarnings("EmptyCatchBlock")
@Test
public void testFailedPushDoesNotLeakConn() throws Exception {
    log.info("Connection pool stats: " + getClientConnectionPoolStats(sut).toString());
    // I.e. check that we are not leaking connections.
    for (int i = 0; i < 10; i++) {
        try {
            sut.push("foobarboooboo" + randomName());
        } catch (ImagePushFailedException ignored) {
        }
        log.info("Connection pool stats: " + getClientConnectionPoolStats(sut).toString());
    }
    assertThat(getClientConnectionPoolStats(sut).getLeased(), equalTo(0));
}
Also used : ImagePushFailedException(com.spotify.docker.client.exceptions.ImagePushFailedException) Endpoint(com.spotify.docker.client.messages.swarm.Endpoint) Test(org.junit.Test)

Aggregations

ImagePushFailedException (com.spotify.docker.client.exceptions.ImagePushFailedException)1 Endpoint (com.spotify.docker.client.messages.swarm.Endpoint)1 Test (org.junit.Test)1