f1amingo opened a new issue, #10562: URL: https://github.com/apache/rocketmq/issues/10562
### Before Creating the Enhancement Request - [x] I have confirmed this should be classified as an enhancement. ### Summary Optimize `PopConsumerServiceTest#transferToFsStoreTest` to avoid starting unnecessary background threads, reducing test execution time from ~1 minute to ~1.3 seconds. ### Motivation The `transferToFsStoreTest` currently calls `consumerService.start()` and `consumerService.shutdown()`, which starts the `PopConsumerService` revive thread and `PopConsumerCache` cleanup thread. However, the test only verifies the `transferToFsStore()` method, which is a synchronous operation that only needs the RocksDB store to be initialized — not the full service lifecycle. The revive background thread repeatedly calls `revive()` which hits NPE due to unmocked `EscapeBridge`, then sleeps 500ms per cycle. Combined with `ServiceThread.waitForRunning()` thread-reference overwrite issues during shutdown, the test takes over 1 minute to complete. ### Describe the Solution You Would Like Replace `consumerService.start()` / `consumerService.shutdown()` with `consumerService.getPopConsumerStore().start()` / `consumerService.getPopConsumerStore().shutdown()`, which only initializes the RocksDB store without starting background threads. This follows the same pattern used by other tests in the same file (e.g., `reviveRetryTest`, `reviveBackoffRetryTest`). ### Describe Alternatives You Have Considered Adding more mocks (e.g., `EscapeBridge`) to prevent NPE in the background thread, but this adds unnecessary complexity for a test that does not need the background threads at all. ### Additional Context - Test execution time: **before ~60s → after ~1.3s** - Test result: same assertions, same pass/fail behavior -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
