Skip to content

Commit

Permalink
Fixed flaky test in LocalMemoryMetadataStoreTest (apache#12540)
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat authored Oct 30, 2021
1 parent 1c9fc07 commit f527a22
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.apache.pulsar.metadata.api.Notification;
import org.apache.pulsar.metadata.api.NotificationType;
import org.apache.pulsar.metadata.api.Stat;
import org.awaitility.Awaitility;
import org.testng.annotations.Test;

public class LocalMemoryMetadataStoreTest {
Expand Down Expand Up @@ -84,7 +85,11 @@ public void testSharedInstance() throws Exception {

store2.delete("/test", Optional.empty()).join();

assertFalse(store1.exists("/test").join());
assertFalse(store2.exists("/test").join());

// The exists will be updated based on the cache invalidation in store1
Awaitility.await().untilAsserted(() -> {
assertFalse(store1.exists("/test").join());
});
}
}

0 comments on commit f527a22

Please sign in to comment.