Making ConcurrentUseTest UT still use async commits, unlike other UTs unprepared for concurrency issues (and actually expecting "old" behaviour).

git-svn-id: https://svn.apache.org/repos/asf/maven/indexer/trunk@1044392 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java b/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java
index d6b923e..ff6db75 100644
--- a/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java
+++ b/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java
@@ -6,6 +6,7 @@
 import junit.framework.Assert;
 
 import org.apache.lucene.search.Query;
+import org.apache.maven.index.context.DefaultIndexingContext;
 import org.apache.maven.index.context.IndexingContext;
 
 public class ConcurrentUseTest
@@ -19,6 +20,9 @@
     protected void prepareNexusIndexer( NexusIndexer nexusIndexer )
         throws Exception
     {
+        // This IS concurrent test, so here, unlike all other UTs, we DO want to have async commits
+        DefaultIndexingContext.BLOCKING_COMMIT = false;
+
         context =
             nexusIndexer.addIndexingContext( "test-default", "test", repo, indexDir, null, null, DEFAULT_CREATORS );
 
@@ -65,6 +69,10 @@
 
         context.commit();
 
+        // sleep more than bottleWarmer does, to be sure commit and reopen happened
+        // BottleWarmer sleeps 1000 millis
+        Thread.sleep( 2000 );
+
         //
 
         Query q = nexusIndexer.constructQuery( MAVEN.GROUP_ID, ai.groupId, SearchType.SCORED );