提交 5508d260 authored 作者: Noel Grandin's avatar Noel Grandin

some basic support for running the vmlens race-condition tool

上级 3e65f279
...@@ -365,6 +365,11 @@ java org.h2.test.TestAll timer ...@@ -365,6 +365,11 @@ java org.h2.test.TestAll timer
*/ */
public boolean travis; public boolean travis;
/**
* the vmlens.com race condition tool
*/
public boolean vmlens;
/** /**
* The lock timeout to use * The lock timeout to use
*/ */
...@@ -506,6 +511,9 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -506,6 +511,9 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
if ("travis".equals(args[0])) { if ("travis".equals(args[0])) {
test.travis = true; test.travis = true;
test.testAll(); test.testAll();
} else if ("vmlens".equals(args[0])) {
test.vmlens = true;
test.testAll();
} else if ("reopen".equals(args[0])) { } else if ("reopen".equals(args[0])) {
System.setProperty("h2.delayWrongPasswordMin", "0"); System.setProperty("h2.delayWrongPasswordMin", "0");
System.setProperty("h2.check2", "false"); System.setProperty("h2.check2", "false");
...@@ -554,7 +562,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -554,7 +562,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
private void testAll() throws Exception { private void testAll() throws Exception {
runTests(); runTests();
if (!travis) { if (!travis && !vmlens) {
Profiler prof = new Profiler(); Profiler prof = new Profiler();
prof.depth = 16; prof.depth = 16;
prof.interval = 1; prof.interval = 1;
...@@ -614,6 +622,9 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -614,6 +622,9 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
memory = true; memory = true;
multiThreaded = true; multiThreaded = true;
test(); test();
if (vmlens) {
return;
}
testUnit(); testUnit();
// lazy // lazy
...@@ -681,7 +692,6 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -681,7 +692,6 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
cipher = null; cipher = null;
test(); test();
} }
} }
/** /**
...@@ -722,6 +732,9 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -722,6 +732,9 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
addTest(new TestCompatibilityOracle()); addTest(new TestCompatibilityOracle());
addTest(new TestCsv()); addTest(new TestCsv());
addTest(new TestDeadlock()); addTest(new TestDeadlock());
if (vmlens) {
return;
}
addTest(new TestDrop()); addTest(new TestDrop());
addTest(new TestDuplicateKeyUpdate()); addTest(new TestDuplicateKeyUpdate());
addTest(new TestEncryptedDb()); addTest(new TestEncryptedDb());
......
...@@ -41,6 +41,10 @@ public class TestOutOfMemory extends TestBase { ...@@ -41,6 +41,10 @@ public class TestOutOfMemory extends TestBase {
// fails regularly under Travis, not sure why // fails regularly under Travis, not sure why
return; return;
} }
if (config.vmlens) {
// running out of memory will cause the vmlens agent to stop working
return;
}
try { try {
System.gc(); System.gc();
testMVStoreUsingInMemoryFileSystem(); testMVStoreUsingInMemoryFileSystem();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论