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));
}
Aggregations