diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/prefetch/CacheWarmingTest.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/prefetch/CacheWarmingTest.java index 7a4740e1d7d..dc50d25f3e9 100644 --- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/prefetch/CacheWarmingTest.java +++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/prefetch/CacheWarmingTest.java @@ -22,6 +22,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeNoException; import static org.junit.Assume.assumeNotNull; import java.util.ArrayList; @@ -31,6 +32,7 @@ import java.util.SortedSet; import java.util.TreeSet; +import com.mongodb.MongoTimeoutException; import org.apache.jackrabbit.oak.api.CommitFailedException; import org.apache.jackrabbit.oak.commons.junit.TemporarySystemProperty; import org.apache.jackrabbit.oak.plugins.document.Collection; @@ -110,7 +112,12 @@ private DocumentStore newMongoDocumentStore() throws InterruptedException { mongoConnection = connectionFactory.getConnection(); assumeNotNull(mongoConnection); db = new CountingMongoDatabase(mongoConnection.getDatabase()); - MongoUtils.dropCollections(db); + try { + MongoUtils.dropCollections(db); + } catch (MongoTimeoutException e) { + LOG.warn("Skipping the current test case, because the collection cleanup in the Mongo DB timed out.", e); + assumeNoException("Skipping the current test case, because the collection cleanup in the Mongo DB timed out.", e); + } DocumentMK.Builder builder = new DocumentMK.Builder() .clock(getTestClock()).setAsyncDelay(0); MongoDocumentStore store = new MongoDocumentStore(mongoConnection.getMongoClient(), db, builder);