diff --git a/pulsar-metadata/src/test/java/org/apache/pulsar/metadata/MetadataStoreTest.java b/pulsar-metadata/src/test/java/org/apache/pulsar/metadata/MetadataStoreTest.java index 888a1186d86e8..fcc89340febdb 100644 --- a/pulsar-metadata/src/test/java/org/apache/pulsar/metadata/MetadataStoreTest.java +++ b/pulsar-metadata/src/test/java/org/apache/pulsar/metadata/MetadataStoreTest.java @@ -29,7 +29,6 @@ import java.util.List; import java.util.Optional; import java.util.Set; -import java.util.UUID; import java.util.concurrent.BlockingQueue; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; @@ -432,10 +431,9 @@ public Object[][] conditionOfSwitchThread(){ @Test(dataProvider = "conditionOfSwitchThread") public void testThreadSwitchOfZkMetadataStore(boolean hasSynchronizer, boolean enabledBatch) throws Exception { final String prefix = newKey(); - final String metadataStoreName = UUID.randomUUID().toString().replaceAll("-", ""); + final String metadataStoreNamePrefix = "metadata-store"; MetadataStoreConfig.MetadataStoreConfigBuilder builder = - MetadataStoreConfig.builder().metadataStoreName(metadataStoreName); - builder.fsyncEnable(false); + MetadataStoreConfig.builder(); builder.batchingEnabled(enabledBatch); if (!hasSynchronizer) { builder.synchronizer(null); @@ -447,8 +445,8 @@ public void testThreadSwitchOfZkMetadataStore(boolean hasSynchronizer, boolean e final Runnable verify = () -> { String currentThreadName = Thread.currentThread().getName(); String errorMessage = String.format("Expect to switch to thread %s, but currently it is thread %s", - metadataStoreName, currentThreadName); - assertTrue(Thread.currentThread().getName().startsWith(metadataStoreName), errorMessage); + metadataStoreNamePrefix, currentThreadName); + assertTrue(Thread.currentThread().getName().startsWith(metadataStoreNamePrefix), errorMessage); }; // put with node which has parent(but the parent node is not exists).