Skip to content

Commit b1eec43

Browse files
committed
Make sure latch is always counted down
1 parent a93e624 commit b1eec43

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

client/src/test/java/org/asynchttpclient/channel/ConnectionPoolTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void testMaxTotalConnectionsException() throws Throwable {
8989
}
9090
}
9191

92-
@Test(groups = "standalone", invocationCount = 10)
92+
@Test(groups = "standalone", invocationCount = 100)
9393
public void asyncDoGetKeepAliveHandlerTest_channelClosedDoesNotFail() throws Exception {
9494

9595
try (AsyncHttpClient client = asyncHttpClient()) {
@@ -111,6 +111,15 @@ public Response onCompleted(Response response) throws Exception {
111111
}
112112
return response;
113113
}
114+
115+
@Override
116+
public void onThrowable(Throwable t) {
117+
try {
118+
super.onThrowable(t);
119+
} finally {
120+
l.countDown();
121+
}
122+
}
114123
};
115124

116125
client.prepareGet(getTargetUrl()).execute(handler).get();

0 commit comments

Comments
 (0)