提交 dbc5987b 编写于 作者: D dongeforever

Fix tests

上级 1a2fe9f8
......@@ -21,10 +21,10 @@ public class StoreTestBase {
protected Set<String> baseDirs = new HashSet<>();
private AtomicInteger port = new AtomicInteger(30000);
private static AtomicInteger port = new AtomicInteger(30000);
public int nextPort() {
return port.incrementAndGet();
public static synchronized int nextPort() {
return port.addAndGet(5);
}
protected MessageExtBrokerInner buildMessage() {
......
......@@ -93,6 +93,7 @@ public class DLegerCommitlogTest extends StoreTestBase {
Assert.assertEquals(results.get(i).getAppendMessageResult().getWroteOffset(), messageExt.getCommitLogOffset());
}
messageStore.destroy();
messageStore.shutdown();
}
......@@ -123,6 +124,9 @@ public class DLegerCommitlogTest extends StoreTestBase {
leaderStore.destroy();
followerStore.destroy();
leaderStore.shutdown();
followerStore.shutdown();
}
......
......@@ -47,7 +47,7 @@ public class IntegrationTestBase {
protected static final List<BrokerController> BROKER_CONTROLLERS = new ArrayList<>();
protected static final List<NamesrvController> NAMESRV_CONTROLLERS = new ArrayList<>();
protected static int topicCreateTime = 30 * 1000;
protected static final int COMMIT_LOG_SIZE = 1024 * 1024 * 256;
protected static final int COMMIT_LOG_SIZE = 1024 * 1024 * 100;
protected static final int INDEX_NUM = 1000;
private static final AtomicInteger port = new AtomicInteger(50000);
......@@ -135,7 +135,7 @@ public class IntegrationTestBase {
brokerConfig.setEnablePropertyFilter(true);
storeConfig.setStorePathRootDir(baseDir);
storeConfig.setStorePathCommitLog(baseDir + SEP + "commitlog");
storeConfig.setMapedFileSizeCommitLog(100 * 1024 * 1024);
storeConfig.setMapedFileSizeCommitLog(COMMIT_LOG_SIZE);
storeConfig.setMaxIndexNum(INDEX_NUM);
storeConfig.setMaxHashSlotNum(INDEX_NUM * 4);
return createAndStartBroker(storeConfig, brokerConfig);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册