提交 802e33f2 authored 作者: Thomas Mueller's avatar Thomas Mueller

Only test smaller databases for now.

上级 65a7a5ad
...@@ -19,6 +19,7 @@ import org.h2.store.fs.FileSystem; ...@@ -19,6 +19,7 @@ import org.h2.store.fs.FileSystem;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.test.utils.Recorder; import org.h2.test.utils.Recorder;
import org.h2.test.utils.RecordingFileSystem; import org.h2.test.utils.RecordingFileSystem;
import org.h2.util.IOUtils;
import org.h2.util.New; import org.h2.util.New;
import org.h2.util.Profiler; import org.h2.util.Profiler;
...@@ -28,6 +29,7 @@ import org.h2.util.Profiler; ...@@ -28,6 +29,7 @@ import org.h2.util.Profiler;
*/ */
public class TestReopen extends TestBase implements Recorder { public class TestReopen extends TestBase implements Recorder {
private static final int MAX_FILE_SIZE = 8 * 1024 * 1024;
private String testDatabase = "memFS:" + TestBase.BASE_TEST_DIR + "/reopen"; private String testDatabase = "memFS:" + TestBase.BASE_TEST_DIR + "/reopen";
private long lastCheck; private long lastCheck;
private int writeCount = Integer.parseInt(System.getProperty("reopenOffset", "0")); private int writeCount = Integer.parseInt(System.getProperty("reopenOffset", "0"));
...@@ -91,6 +93,10 @@ public class TestReopen extends TestBase implements Recorder { ...@@ -91,6 +93,10 @@ public class TestReopen extends TestBase implements Recorder {
if ((writeCount & (testEvery - 1)) != 0) { if ((writeCount & (testEvery - 1)) != 0) {
return; return;
} }
if (IOUtils.length(fileName) > MAX_FILE_SIZE) {
// System.out.println(fileName + " " + IOUtils.length(fileName));
return;
}
FileSystem.getInstance(fileName).copy(fileName, testDatabase + Constants.SUFFIX_PAGE_FILE); FileSystem.getInstance(fileName).copy(fileName, testDatabase + Constants.SUFFIX_PAGE_FILE);
try { try {
verifyCount++; verifyCount++;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论