From b15370842c482bae3d4e5c5b5b9707b79bef7dde Mon Sep 17 00:00:00 2001 From: Heesung Sohn Date: Fri, 19 Apr 2024 13:19:56 -0700 Subject: [PATCH] added ut --- .../apache/pulsar/metadata/MetadataStoreTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 a8c7cf2735090e..bc50c56ebf7a8a 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 @@ -33,6 +33,7 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; +import java.util.concurrent.ExecutionException; import java.util.concurrent.LinkedBlockingDeque; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; @@ -443,7 +444,7 @@ public Object[][] conditionOfSwitchThread(){ }; } - @Test(dataProvider = "conditionOfSwitchThread") + @Test(dataProvider = "conditionOfSwitchThread", invocationTimeOut = 30_000) public void testThreadSwitchOfZkMetadataStore(boolean hasSynchronizer, boolean enabledBatch) throws Exception { final String prefix = newKey(); final String metadataStoreName = UUID.randomUUID().toString().replaceAll("-", ""); @@ -481,6 +482,17 @@ public void testThreadSwitchOfZkMetadataStore(boolean hasSynchronizer, boolean e verify.run(); return null; }).join(); + // blocking chaining call + store.get(prefix + "/d1") + .thenApply((ignore) -> + { + try { + return store.get(prefix + "/e1").get(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + ).get(5, TimeUnit.SECONDS); // get the node which is not exists. store.get(prefix + "/non").thenApply((ignore) -> { verify.run();