Skip to content

Commit

Permalink
added ut
Browse files Browse the repository at this point in the history
  • Loading branch information
heesung-sn committed Apr 19, 2024
1 parent 76c1b4e commit b153708
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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("-", "");
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit b153708

Please sign in to comment.