diff --git a/tieredstore/src/test/java/org/apache/rocketmq/tieredstore/index/IndexStoreFileTest.java b/tieredstore/src/test/java/org/apache/rocketmq/tieredstore/index/IndexStoreFileTest.java index 0da7611559a0..4d17d435bf96 100644 --- a/tieredstore/src/test/java/org/apache/rocketmq/tieredstore/index/IndexStoreFileTest.java +++ b/tieredstore/src/test/java/org/apache/rocketmq/tieredstore/index/IndexStoreFileTest.java @@ -60,6 +60,7 @@ public void init() throws IOException { UUID.randomUUID().toString().replace("-", "").substring(0, 8)).toString(); storeConfig = new TieredMessageStoreConfig(); storeConfig.setStorePathRootDir(filePath); + storeConfig.setTieredStoreFilePath(filePath); storeConfig.setTieredStoreIndexFileMaxHashSlotNum(5); storeConfig.setTieredStoreIndexFileMaxIndexNum(20); storeConfig.setTieredBackendServiceProvider("org.apache.rocketmq.tieredstore.provider.posix.PosixFileSegment"); @@ -73,6 +74,7 @@ public void shutdown() { this.indexStoreFile.destroy(); } TieredStoreTestUtil.destroyMetadataStore(); + TieredStoreTestUtil.destroyTempDir(storeConfig.getStorePathRootDir()); TieredStoreTestUtil.destroyTempDir(storeConfig.getTieredStoreFilePath()); TieredStoreExecutor.shutdown(); } @@ -222,7 +224,7 @@ public void doCompactionTest() throws Exception { ByteBuffer byteBuffer = indexStoreFile.doCompaction(); TieredFileSegment fileSegment = new PosixFileSegment( - storeConfig, FileSegmentType.INDEX, "store_index", 0L); + storeConfig, FileSegmentType.INDEX, storeConfig.getTieredStoreFilePath(), 0L); fileSegment.append(byteBuffer, timestamp); fileSegment.commit(); Assert.assertEquals(byteBuffer.limit(), fileSegment.getSize()); @@ -255,7 +257,7 @@ public void queryAsyncFromSegmentFileTest() throws ExecutionException, Interrupt ByteBuffer byteBuffer = indexStoreFile.doCompaction(); TieredFileSegment fileSegment = new PosixFileSegment( - storeConfig, FileSegmentType.INDEX, "store_index", 0L); + storeConfig, FileSegmentType.INDEX, storeConfig.getTieredStoreFilePath(), 0L); fileSegment.append(byteBuffer, timestamp); fileSegment.commit(); Assert.assertEquals(byteBuffer.limit(), fileSegment.getSize()); diff --git a/tieredstore/src/test/java/org/apache/rocketmq/tieredstore/index/IndexStoreServiceTest.java b/tieredstore/src/test/java/org/apache/rocketmq/tieredstore/index/IndexStoreServiceTest.java index 759115558c60..7002a081d30f 100644 --- a/tieredstore/src/test/java/org/apache/rocketmq/tieredstore/index/IndexStoreServiceTest.java +++ b/tieredstore/src/test/java/org/apache/rocketmq/tieredstore/index/IndexStoreServiceTest.java @@ -37,6 +37,7 @@ import org.apache.rocketmq.logging.org.slf4j.Logger; import org.apache.rocketmq.logging.org.slf4j.LoggerFactory; import org.apache.rocketmq.store.logfile.DefaultMappedFile; +import org.apache.rocketmq.tieredstore.TieredStoreTestUtil; import org.apache.rocketmq.tieredstore.common.AppendResult; import org.apache.rocketmq.tieredstore.common.TieredMessageStoreConfig; import org.apache.rocketmq.tieredstore.common.TieredStoreExecutor; @@ -72,6 +73,7 @@ public void init() throws IOException, ClassNotFoundException, NoSuchMethodExcep UUID.randomUUID().toString().replace("-", "").substring(0, 8)).toString(); storeConfig = new TieredMessageStoreConfig(); storeConfig.setStorePathRootDir(filePath); + storeConfig.setTieredStoreFilePath(filePath); storeConfig.setTieredStoreIndexFileMaxHashSlotNum(5); storeConfig.setTieredStoreIndexFileMaxIndexNum(20); storeConfig.setTieredBackendServiceProvider("org.apache.rocketmq.tieredstore.provider.posix.PosixFileSegment"); @@ -84,6 +86,9 @@ public void shutdown() { indexService.shutdown(); indexService.destroy(); } + TieredStoreTestUtil.destroyMetadataStore(); + TieredStoreTestUtil.destroyTempDir(storeConfig.getStorePathRootDir()); + TieredStoreTestUtil.destroyTempDir(storeConfig.getTieredStoreFilePath()); TieredStoreExecutor.shutdown(); }