提交 bc332d59 authored 作者: Thomas Mueller's avatar Thomas Mueller

When running in reopen mode, some of the tests are expected to fail because they…

When running in reopen mode, some of the tests are expected to fail because they use dangerous operations (LOG=0,...)
上级 6737ea09
......@@ -253,7 +253,7 @@ java org.h2.test.TestAll timer
/**
* Test using the recording file system.
*/
public boolean record;
public boolean reopen;
/**
* Test the split file system.
......@@ -331,7 +331,7 @@ java org.h2.test.TestAll timer
}
private static void run(String... args) throws Exception {
SelfDestructor.startCountdown(3 * 60);
SelfDestructor.startCountdown(4 * 60);
long time = System.currentTimeMillis();
printSystemInfo();
System.setProperty("h2.maxMemoryRowsDistinct", "128");
......@@ -380,9 +380,9 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
System.setProperty("h2.lobInDatabase", "true");
System.setProperty("h2.analyzeAuto", "100");
System.setProperty("h2.pageSize", "64");
System.setProperty("h2.reopenShift", "3");
System.setProperty("h2.reopenShift", "5");
RecordingFileSystem.register();
test.record = true;
test.reopen = true;
TestReopen reopen = new TestReopen();
RecordingFileSystem.setRecorder(reopen);
test.runTests();
......
......@@ -223,7 +223,7 @@ public abstract class TestBase {
public String getBaseDir() {
String dir = baseDir;
if (config != null) {
if (config.record) {
if (config.reopen) {
dir = RecordingFileSystem.PREFIX + "memFS:" + dir;
}
if (config.splitFileSystem) {
......
......@@ -676,7 +676,7 @@ public class TestCases extends TestBase {
}
time = System.currentTimeMillis() - time;
if (time > 5000) {
if (!config.record) {
if (!config.reopen) {
fail("closing took " + time);
}
}
......
......@@ -422,7 +422,7 @@ public class TestLinkedTable extends TestBase {
}
private void testLinkTable() throws SQLException {
if (config.memory || config.networked) {
if (config.memory || config.networked || config.reopen) {
return;
}
......
......@@ -61,7 +61,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
}
private void testErrorMessageWrongSplit() throws Exception {
if (config.memory) {
if (config.memory || config.reopen) {
return;
}
FileSystem.getInstance("split:").delete("split:" + getBaseDir() + "/openClose2.h2.db");
......
......@@ -227,7 +227,7 @@ public class TestRunscript extends TestBase implements Trigger {
assertEqualDatabases(stat1, stat2);
if (!config.memory) {
if (!config.memory && !config.reopen) {
conn1.close();
if (config.cipher != null) {
......
......@@ -33,6 +33,9 @@ public class TestSQLInjection extends TestBase {
}
public void test() throws SQLException {
if (config.reopen) {
return;
}
deleteDb("sqlInjection");
reconnect("sqlInjection");
stat.execute("DROP TABLE IF EXISTS USERS");
......
......@@ -52,7 +52,7 @@ public class TestCache extends TestBase implements CacheWriter {
}
private void testTQ() throws Exception {
if (config.memory) {
if (config.memory || config.reopen) {
return;
}
deleteDb("cache");
......
......@@ -139,6 +139,9 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
}
private void testDefrag() throws SQLException {
if (config.reopen) {
return;
}
deleteDb("pageStore");
Connection conn = getConnection("pageStore;LOG=0;UNDO_LOG=0;LOCK_MODE=0");
Statement stat = conn.createStatement();
......@@ -213,7 +216,7 @@ public class TestPageStore extends TestBase implements DatabaseEventListener {
long after = System.currentTimeMillis();
// it's hard to test - basically it shouldn't checkpoint too often
if (after - before > 10000) {
if (!config.record) {
if (!config.reopen) {
fail("Checkpoint took " + (after - before) + " ms");
}
}
......
......@@ -53,7 +53,7 @@ public class TestReopen extends TestBase implements Recorder {
System.setProperty("h2.delayWrongPasswordMin", "0");
RecordingFileSystem.register();
RecordingFileSystem.setRecorder(this);
config.record = true;
config.reopen = true;
long time = System.currentTimeMillis();
Profiler p = new Profiler();
......@@ -120,6 +120,7 @@ public class TestReopen extends TestBase implements Recorder {
return;
}
e.printStackTrace(System.out);
throw e;
} catch (Exception e) {
// failed
int errorCode = 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论