Skip to content

Commit 8242c1e

Browse files
authored
[ISSUE #10562] Optimize PopConsumerServiceTest#transferToFsStoreTest to avoid unnecessary background threads (#10563)
- Replace consumerService.start() with consumerService.getPopConsumerStore().start() - Replace consumerService.shutdown() with consumerService.getPopConsumerStore().shutdown() - Avoid starting revive/cache background threads that are not needed for transferToFsStore verification - Reduces test execution time from ~60s to ~1.3s
1 parent 1730dbc commit 8242c1e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

broker/src/test/java/org/apache/rocketmq/broker/pop/PopConsumerServiceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,10 @@ public void transferToFsStoreTest() {
464464
.thenReturn(CompletableFuture.completedFuture(
465465
new PutMessageResult(PutMessageStatus.PUT_OK, new AppendMessageResult(AppendMessageStatus.PUT_OK))));
466466

467-
consumerService.start();
467+
consumerService.getPopConsumerStore().start();
468468
consumerService.getPopConsumerStore().writeRecords(consumerRecordList);
469469
consumerService.transferToFsStore();
470-
consumerService.shutdown();
470+
consumerService.getPopConsumerStore().shutdown();
471471
}
472472

473473
@Test

0 commit comments

Comments
 (0)