提交 2962ea18 authored 作者: Noel Grandin's avatar Noel Grandin

cleanup ExecutorService after test

上级 9fb8b74e
...@@ -319,6 +319,7 @@ public class TestMultiThread extends TestBase implements Runnable { ...@@ -319,6 +319,7 @@ public class TestMultiThread extends TestBase implements Runnable {
conn.close(); conn.close();
// create views that reference the common views in different threads // create views that reference the common views in different threads
final ExecutorService executor = Executors.newFixedThreadPool(8); final ExecutorService executor = Executors.newFixedThreadPool(8);
try {
final ArrayList<Future<Void>> jobs = new ArrayList<Future<Void>>(); final ArrayList<Future<Void>> jobs = new ArrayList<Future<Void>>();
for (int i = 0; i < 1000; i++) { for (int i = 0; i < 1000; i++) {
final int j = i; final int j = i;
...@@ -369,8 +370,10 @@ public class TestMultiThread extends TestBase implements Runnable { ...@@ -369,8 +370,10 @@ public class TestMultiThread extends TestBase implements Runnable {
} }
} }
} }
} finally {
executor.shutdown(); executor.shutdown();
executor.awaitTermination(20, TimeUnit.SECONDS); executor.awaitTermination(20, TimeUnit.SECONDS);
}
deleteDb("lockMode"); deleteDb("lockMode");
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论