提交 82ae5a95 authored 作者: Noel Grandin's avatar Noel Grandin

fix TestMultiThread test failure

the problem was that the first database connection closing would
sometimes lead to the database being deleted before the other
connections got going
上级 90d99810
...@@ -316,11 +316,6 @@ public class TestMultiThread extends TestBase implements Runnable { ...@@ -316,11 +316,6 @@ public class TestMultiThread extends TestBase implements Runnable {
"CREATE VIEW INVOICE_DETAIL_VIEW as SELECT * FROM INVOICE_DETAIL"); "CREATE VIEW INVOICE_DETAIL_VIEW as SELECT * FROM INVOICE_DETAIL");
stat.close(); stat.close();
conn.close();
// Without this we fail when testing in "mvstore net memory" mode with "Table INVOICE_VIEW not found"
// which is not the point of this test, so just workaround
Thread.sleep(100);
// 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);
...@@ -376,6 +371,7 @@ public class TestMultiThread extends TestBase implements Runnable { ...@@ -376,6 +371,7 @@ public class TestMultiThread extends TestBase implements Runnable {
} }
} }
} finally { } finally {
conn.close();
executor.shutdown(); executor.shutdown();
executor.awaitTermination(20, TimeUnit.SECONDS); executor.awaitTermination(20, TimeUnit.SECONDS);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论