提交 597adf69 authored 作者: andrei's avatar andrei

close connection

上级 325eae3c
......@@ -98,13 +98,17 @@ public class TestConnectionPool extends TestBase {
};
t.execute();
long time = System.nanoTime();
Connection conn2 = null;
try {
// connection 2 (of 1 or 2) may fail
man.getConnection();
conn2 = man.getConnection();
// connection 3 (of 1 or 2) must fail
man.getConnection();
fail();
} catch (SQLException e) {
if (conn2 != null) {
conn2.close();
}
assertContains(e.toString().toLowerCase(), "timeout");
time = System.nanoTime() - time;
assertTrue("timeout after " + TimeUnit.NANOSECONDS.toMillis(time) +
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论