提交 87ad9f21 authored 作者: Thomas Mueller's avatar Thomas Mueller

Investigate why closing a file sometimes takes 45 seconds (see also…

Investigate why closing a file sometimes takes 45 seconds (see also http://stackoverflow.com/questions/4760809/closing-a-randomaccessfile-sometimes-takes-exactly-45-seconds)
上级 29799c2e
...@@ -322,7 +322,7 @@ java org.h2.test.TestAll timer ...@@ -322,7 +322,7 @@ java org.h2.test.TestAll timer
SelfDestructor.startCountdown(3 * 60); SelfDestructor.startCountdown(3 * 60);
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
TestAll test = new TestAll(); TestAll test = new TestAll();
test.printSystem(); test.printSystemInfo();
System.setProperty("h2.maxMemoryRowsDistinct", "128"); System.setProperty("h2.maxMemoryRowsDistinct", "128");
System.setProperty("h2.check2", "true"); System.setProperty("h2.check2", "true");
...@@ -723,13 +723,17 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -723,13 +723,17 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
FileSystemDisk.getInstance().deleteRecursive(TestBase.BASE_TEST_DIR, true); FileSystemDisk.getInstance().deleteRecursive(TestBase.BASE_TEST_DIR, true);
} }
private void printSystem() { /**
* Print system information.
*/
public static void printSystemInfo() {
Properties prop = System.getProperties(); Properties prop = System.getProperties();
System.out.println("H2 " + Constants.getFullVersion() + " @ " + new java.sql.Timestamp(System.currentTimeMillis()).toString()); System.out.println("H2 " + Constants.getFullVersion() + " @ " + new java.sql.Timestamp(System.currentTimeMillis()).toString());
System.out.println("Java " + System.out.println("Java " +
prop.getProperty("java.runtime.version") + ", " + prop.getProperty("java.runtime.version") + ", " +
prop.getProperty("java.vm.name")+", " + prop.getProperty("java.vm.name")+", " +
prop.getProperty("java.vendor")); prop.getProperty("java.vendor") + ", " +
prop.getProperty("sun.arch.data.model"));
System.out.println( System.out.println(
prop.getProperty("os.name") + ", " + prop.getProperty("os.name") + ", " +
prop.getProperty("os.arch")+", "+ prop.getProperty("os.arch")+", "+
......
...@@ -11,6 +11,7 @@ import java.sql.ResultSet; ...@@ -11,6 +11,7 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import org.h2.test.TestAll;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.util.Task; import org.h2.util.Task;
...@@ -31,6 +32,7 @@ public class CopyOfTestMvccMultiThreaded extends TestBase { ...@@ -31,6 +32,7 @@ public class CopyOfTestMvccMultiThreaded extends TestBase {
} }
public void test() throws Exception { public void test() throws Exception {
TestAll.printSystemInfo();
int test; int test;
if (config.big && !config.networked) if (config.big && !config.networked)
for(int i=0; ; i++) { for(int i=0; ; i++) {
...@@ -81,7 +83,8 @@ try{ ...@@ -81,7 +83,8 @@ try{
} }
}catch(Exception e) { }catch(Exception e) {
// System.out.println(buff); // System.out.println(buff);
e.printStackTrace(System.out); System.out.println(e.toString());
// e.printStackTrace(System.out);
} }
long time = System.currentTimeMillis() - startThread; long time = System.currentTimeMillis() - startThread;
//if (time > 10000) { //if (time > 10000) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论