Skip to content

Commit

Permalink
[fix][test] Fix test testThreadSwitchOfZkMetadataStore (#20446)
Browse files Browse the repository at this point in the history
  • Loading branch information
poorbarcode authored Jun 1, 2023
1 parent 1b5bf49 commit c54edc9
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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).
Expand Down

0 comments on commit c54edc9

Please sign in to comment.