wuxuanqicn commented on code in PR #16005:
URL: https://github.com/apache/pulsar/pull/16005#discussion_r894598868


##########
pulsar-metadata/src/test/java/org/apache/pulsar/metadata/MetadataStoreTest.java:
##########
@@ -447,4 +448,33 @@ public void run() {
         assertEquals(successWrites.get(), maxValue);
         assertEquals(store.get(path).get().get().getValue()[0], maxValue);
     }
+
+    @Test(dataProvider = "impl")
+    public void testConcurrentPut(String provider, Supplier<String> 
urlSupplier) throws Exception {
+        MetadataStore store = MetadataStoreFactory.create(urlSupplier.get(), 
MetadataStoreConfig.builder().build());
+
+        String k = newKey();
+        CompletableFuture<Void> f1 =
+                CompletableFuture.runAsync(() -> store.put(k, new byte[0], 
Optional.of(-1L)).join());
+        CompletableFuture<Void> f2 =
+                CompletableFuture.runAsync(() -> store.put(k, new byte[0], 
Optional.of(-1L)).join());

Review Comment:
   more operations are needed, if we are testing concurrent operation, 
   
https://github.com/apache/pulsar/blob/master/pulsar-common/src/test/java/org/apache/pulsar/common/util/collections/GrowablePriorityLongPairQueueTest.java#L164-L187



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to