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 a8c7cf2735090..50d3b924d66d0 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 @@ -443,7 +443,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 +481,19 @@ public void testThreadSwitchOfZkMetadataStore(boolean hasSynchronizer, boolean e verify.run(); return null; }).join(); + // blocking chaining call + store.get(prefix + "/d1").thenApply((ignore) -> { + try { + verify.run(); + return store.get(prefix + "/e1").thenApply((ignore2) -> { + verify.run(); + return null; + }).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();