提交 dcb7c081 编写于 作者: Q qqeasonchen

unit test of statistics persistence modified

上级 d4c4baf2
......@@ -66,7 +66,7 @@ public class DefaultMessageStoreCleanFilesTest {
}
@Test
public void testIsSpaceFullFunction() throws Exception {
public void testIsSpaceFullFunctionEmpty2Full() throws Exception {
String deleteWhen = "04";
// the min value of diskMaxUsedSpaceRatio.
int diskMaxUsedSpaceRatio = 1;
......@@ -85,16 +85,19 @@ public class DefaultMessageStoreCleanFilesTest {
messageStore.shutdown();
messageStore.destroy();
}
@Test
public void testIsSpaceFullFunctionFull2Empty() throws Exception {
String deleteWhen = "04";
// the min value of diskMaxUsedSpaceRatio.
int diskMaxUsedSpaceRatio = 1;
//use to reset diskfull flag
diskSpaceCleanForciblyRatio = 0.999D;
double diskSpaceCleanForciblyRatio = 0.999D;
initMessageStore(deleteWhen, diskMaxUsedSpaceRatio, diskSpaceCleanForciblyRatio);
// build and put 55 messages, exactly one message per CommitLog file.
buildAndPutMessagesToMessageStore(msgCount);
commitLogQueue = getMappedFileQueueCommitLog();
assertEquals(fileCountCommitLog, commitLogQueue.getMappedFiles().size());
fileCountConsumeQueue = getFileCountConsumeQueue();
consumeQueue = getMappedFileQueueConsumeQueue();
assertEquals(fileCountConsumeQueue, consumeQueue.getMappedFiles().size());
//set disk full
messageStore.getRunningFlags().getAndMakeDiskFull();
cleanCommitLogService.isSpaceFull();
assertEquals(0, messageStore.getRunningFlags().getFlagBits() & (1 << 4));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册