提交 e5abed47 authored 作者: Noel Grandin's avatar Noel Grandin

don't mess with the test config settings during the test run

otherwise we're not actually testing what we want to test, and it's darn hard to track down bugs in the test code
上级 382930ab
...@@ -5,13 +5,12 @@ ...@@ -5,13 +5,12 @@
*/ */
package org.h2.test.synth; package org.h2.test.synth;
import org.h2.test.TestBase;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Statement; import java.sql.Statement;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import org.h2.test.TestBase;
/** /**
* Tests lock releasing for concurrent select statements * Tests lock releasing for concurrent select statements
...@@ -26,15 +25,15 @@ public class TestReleaseSelectLock extends TestBase { ...@@ -26,15 +25,15 @@ public class TestReleaseSelectLock extends TestBase {
* @param a ignored * @param a ignored
*/ */
public static void main(String... a) throws Exception { public static void main(String... a) throws Exception {
TestBase.createCaller().init().test(); TestBase test = TestBase.createCaller().init();
test.config.mvStore = false;
test.config.mvcc = false;
test.config.multiThreaded = true;
test.test();
} }
@Override @Override
public void test() throws Exception { public void test() throws Exception {
config.mvStore = false;
config.mvcc = false;
config.multiThreaded = true;
deleteDb(TEST_DB_NAME); deleteDb(TEST_DB_NAME);
Connection conn = getConnection(TEST_DB_NAME); Connection conn = getConnection(TEST_DB_NAME);
......
...@@ -25,7 +25,6 @@ import java.util.concurrent.ExecutionException; ...@@ -25,7 +25,6 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import org.h2.api.ErrorCode; import org.h2.api.ErrorCode;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.tools.Server; import org.h2.tools.Server;
...@@ -41,15 +40,16 @@ public class TestPgServer extends TestBase { ...@@ -41,15 +40,16 @@ public class TestPgServer extends TestBase {
* @param a ignored * @param a ignored
*/ */
public static void main(String... a) throws Exception { public static void main(String... a) throws Exception {
TestBase.createCaller().init().test(); TestBase test = TestBase.createCaller().init();
test.config.memory = true;
test.test();
} }
@Override @Override
public void test() throws Exception { public void test() throws Exception {
config.multiThreaded = true; if (!config.memory) {
config.memory = true; return;
config.mvStore = true; }
config.mvcc = true;
// testPgAdapter() starts server by itself without a wait so run it first // testPgAdapter() starts server by itself without a wait so run it first
testPgAdapter(); testPgAdapter();
testLowerCaseIdentifiers(); testLowerCaseIdentifiers();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论