You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by kl...@apache.org on 2007/02/03 04:59:05 UTC
svn commit: r503169 -
/lucene/solr/trunk/src/test/org/apache/solr/update/AutoCommitTest.java
Author: klaas
Date: Fri Feb 2 19:59:04 2007
New Revision: 503169
URL: http://svn.apache.org/viewvc?view=rev&rev=503169
Log:
Patches autocommit max docs test to be less time-sensitive
Modified:
lucene/solr/trunk/src/test/org/apache/solr/update/AutoCommitTest.java
Modified: lucene/solr/trunk/src/test/org/apache/solr/update/AutoCommitTest.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/org/apache/solr/update/AutoCommitTest.java?view=diff&rev=503169&r1=503168&r2=503169
==============================================================================
--- lucene/solr/trunk/src/test/org/apache/solr/update/AutoCommitTest.java (original)
+++ lucene/solr/trunk/src/test/org/apache/solr/update/AutoCommitTest.java Fri Feb 2 19:59:04 2007
@@ -68,7 +68,7 @@
DirectUpdateHandler2 updater = (DirectUpdateHandler2)SolrCore.getSolrCore().getUpdateHandler();
DirectUpdateHandler2.CommitTracker tracker = updater.tracker;
tracker.timeUpperBound = -1;
- tracker.docsUpperBound = 5;
+ tracker.docsUpperBound = 14;
XmlUpdateRequestHandler handler = new XmlUpdateRequestHandler();
handler.init( null );
@@ -79,7 +79,7 @@
// Add a single document
SolrQueryResponse rsp = new SolrQueryResponse();
SolrQueryRequestBase req = new SolrQueryRequestBase( core, params ) {};
- for( int i=0; i<15; i++ ) {
+ for( int i=0; i<14; i++ ) {
req.setContentStreams( toContentStreams(
adoc("id", "A"+i, "subject", "info" ), null ) );
handler.handleRequest( req, rsp );
@@ -88,6 +88,9 @@
assertQ("shouldn't find any", req("id:A1") ,"//result[@numFound=0]" );
assertEquals( 0, tracker.autoCommitCount );
+ req.setContentStreams( toContentStreams(
+ adoc("id", "A14", "subject", "info" ), null ) );
+ handler.handleRequest( req, rsp );
// Wait longer then the autocommit time
Thread.sleep( 500 );
@@ -96,7 +99,7 @@
assertEquals( 1, tracker.autoCommitCount );
// Now add some more
- for( int i=0; i<15; i++ ) {
+ for( int i=0; i<14; i++ ) {
req.setContentStreams( toContentStreams(
adoc("id", "B"+i, "subject", "info" ), null ) );
handler.handleRequest( req, rsp );
@@ -105,7 +108,11 @@
assertQ("shouldn't find any", req("id:B1") ,"//result[@numFound=0]" );
assertEquals( 1, tracker.autoCommitCount );
+ req.setContentStreams( toContentStreams(
+ adoc("id", "B14", "subject", "info" ), null ) );
+ handler.handleRequest( req, rsp );
Thread.sleep( 500 );
+
assertQ("should find one", req("id:B1") ,"//result[@numFound=1]" );
assertEquals( 2, tracker.autoCommitCount );
}