This is an automated email from the ASF dual-hosted git repository.

technoboy pushed a commit to branch branch-2.11
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.11 by this push:
     new c54edc91e7f [fix][test] Fix test `testThreadSwitchOfZkMetadataStore` 
(#20446)
c54edc91e7f is described below

commit c54edc91e7f8de7298b669ad256899775f794ee2
Author: fengyubiao <[email protected]>
AuthorDate: Thu Jun 1 09:44:40 2023 +0800

    [fix][test] Fix test `testThreadSwitchOfZkMetadataStore` (#20446)
---
 .../java/org/apache/pulsar/metadata/MetadataStoreTest.java     | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

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 888a1186d86..fcc89340feb 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.Collections;
 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 class MetadataStoreTest extends 
BaseMetadataStoreTest {
     @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 class MetadataStoreTest extends 
BaseMetadataStoreTest {
         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).

Reply via email to