Author: cstamas Date: Fri Dec 10 15:02:27 2010 New Revision: 1044392 URL: http://svn.apache.org/viewvc?rev=1044392&view=rev Log: Making ConcurrentUseTest UT still use async commits, unlike other UTs unprepared for concurrency issues (and actually expecting "old" behaviour).
Modified: maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java Modified: maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java URL: http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java?rev=1044392&r1=1044391&r2=1044392&view=diff ============================================================================== --- maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java (original) +++ maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java Fri Dec 10 15:02:27 2010 @@ -6,6 +6,7 @@ import java.util.concurrent.atomic.Atomi 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 @@ public class ConcurrentUseTest 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 @@ public class ConcurrentUseTest 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 );