4242import org .apache .rocketmq .store .queue .RocksDBConsumeQueueStore ;
4343import org .apache .rocketmq .store .stats .BrokerStatsManager ;
4444import org .awaitility .Awaitility ;
45+ import org .junit .After ;
4546import org .junit .Assert ;
4647import org .junit .Before ;
4748import 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