Skip to content

Commit dcdd560

Browse files
committed
fix RocksdbTransferOffsetAndCqTest
Change-Id: I11a92eaa95f83afdda9533cd0de6857a3fbde127
1 parent fe99e99 commit dcdd560

1 file changed

Lines changed: 8 additions & 19 deletions

File tree

broker/src/test/java/org/apache/rocketmq/broker/offset/RocksdbTransferOffsetAndCqTest.java

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.apache.rocketmq.store.queue.RocksDBConsumeQueueStore;
4343
import org.apache.rocketmq.store.stats.BrokerStatsManager;
4444
import org.awaitility.Awaitility;
45+
import org.junit.After;
4546
import org.junit.Assert;
4647
import org.junit.Before;
4748
import org.junit.Test;
@@ -73,9 +74,6 @@ public class RocksdbTransferOffsetAndCqTest {
7374

7475
@Before
7576
public void init() throws IOException {
76-
if (notToBeExecuted()) {
77-
return;
78-
}
7977
BrokerConfig brokerConfig = new BrokerConfig();
8078
brokerConfig.setConsumerOffsetUpdateVersionStep(10);
8179
MessageStoreConfig messageStoreConfig = new MessageStoreConfig();
@@ -94,12 +92,15 @@ public void init() throws IOException {
9492
rocksdbConsumerOffsetManager = new RocksDBConsumerOffsetManager(brokerController);
9593
}
9694

95+
@After
96+
public void shutdown() {
97+
consumerOffsetManager.shutdown();
98+
rocksdbConsumerOffsetManager.shutdown();
99+
defaultMessageStore.shutdown();
100+
}
101+
97102
@Test
98103
public void testTransferOffset() {
99-
if (notToBeExecuted()) {
100-
return;
101-
}
102-
103104
for (int i = 0; i < 200; i++) {
104105
consumerOffsetManager.commitOffset(clientHost, group, topic, queueId, i);
105106
}
@@ -133,9 +134,6 @@ public void testTransferOffset() {
133134

134135
@Test
135136
public void testRocksdbCqWrite() throws RocksDBException {
136-
if (notToBeExecuted()) {
137-
return;
138-
}
139137
long startTimestamp = System.currentTimeMillis();
140138

141139
ConsumeQueueStoreInterface combineConsumeQueueStore = defaultMessageStore.getQueueStore();
@@ -166,13 +164,4 @@ public void testRocksdbCqWrite() throws RocksDBException {
166164
CheckRocksdbCqWriteResult result = ((CombineConsumeQueueStore) combineConsumeQueueStore).doCheckCqWriteProgress(topic, startTimestamp, StoreType.DEFAULT, StoreType.DEFAULT_ROCKSDB);
167165
Assert.assertEquals(CheckRocksdbCqWriteResult.CheckStatus.CHECK_OK.getValue(), result.getCheckStatus());
168166
}
169-
170-
/**
171-
* No need to skip macOS platform.
172-
* @return true if some platform is NOT a good fit for this test case.
173-
*/
174-
private boolean notToBeExecuted() {
175-
return false;
176-
}
177-
178167
}

0 commit comments

Comments
 (0)