提交 36ad925a authored 作者: Noel Grandin's avatar Noel Grandin

fix cache size calculation in TestJmx

in pagestore mode we scale it by the size of available RAM
上级 e5abed47
......@@ -16,7 +16,9 @@ import javax.management.MBeanInfo;
import javax.management.MBeanOperationInfo;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import org.h2.engine.Constants;
import org.h2.test.TestBase;
import org.h2.util.Utils;
/**
* Tests the JMX feature.
......@@ -29,7 +31,10 @@ public class TestJmx extends TestBase {
* @param a ignored
*/
public static void main(String... a) throws Exception {
TestBase.createCaller().init().test();
TestBase base = TestBase.createCaller().init();
base.config.mvStore = false;
base.config.mvcc = false;
base.test();
}
@Override
......@@ -144,7 +149,9 @@ public class TestJmx extends TestBase {
assertEquals("0", mbeanServer.
getAttribute(name, "CacheSizeMax").toString());
} else {
assertEquals("16384", mbeanServer.
int cacheSize = Utils.scaleForAvailableMemory(
Constants.CACHE_SIZE_DEFAULT);
assertEquals("" + cacheSize, mbeanServer.
getAttribute(name, "CacheSizeMax").toString());
}
mbeanServer.setAttribute(name, new Attribute("CacheSizeMax", 1));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论