提交 ceebdf6c authored 作者: Sergi Vladykin's avatar Sergi Vladykin

Fix TestQueryCache

上级 dc4e0cbc
...@@ -54,7 +54,7 @@ public class TestQueryCache extends TestBase { ...@@ -54,7 +54,7 @@ public class TestQueryCache extends TestBase {
ResultSet rs; ResultSet rs;
long first = 0; long first = 0;
// 1000 iterations to warm up and avoid JIT effects // 1000 iterations to warm up and avoid JIT effects
for (int i = 0; i < 1010; i++) { for (int i = 0; i < 1005; i++) {
// this should both ensure results are not re-used // this should both ensure results are not re-used
// stat.execute("set mode regular"); // stat.execute("set mode regular");
// stat.execute("create table x()"); // stat.execute("create table x()");
...@@ -74,6 +74,8 @@ public class TestQueryCache extends TestBase { ...@@ -74,6 +74,8 @@ public class TestQueryCache extends TestBase {
prep = conn.prepareStatement(query); prep = conn.prepareStatement(query);
} else if (i == 1001) { } else if (i == 1001) {
first = time; first = time;
// try to avoid pauses in subsequent iterations
System.gc();
} else if (i > 1001) { } else if (i > 1001) {
assertSmaller(time, first); assertSmaller(time, first);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论