lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dor...@apache.org
Subject svn commit: r682619 - in /lucene/java/trunk: CHANGES.txt src/test/org/apache/lucene/search/TestTimeLimitedCollector.java
Date Tue, 05 Aug 2008 07:58:07 GMT
Author: doronc
Date: Tue Aug  5 00:58:07 2008
New Revision: 682619

URL: http://svn.apache.org/viewvc?rev=682619&view=rev
Log:
LUCENE-1348: relax TestTimeLimitedCollector.

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/src/test/org/apache/lucene/search/TestTimeLimitedCollector.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=682619&r1=682618&r2=682619&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Tue Aug  5 00:58:07 2008
@@ -257,6 +257,8 @@
     Within this fix, "greedy" flag was added to TimeLimitedCollector, to allow the wrapped

     collector to collect also the last doc, after allowed-tTime passed. (Doron Cohen)   
 	
+ 2. LUCENE-1348: relax TestTimeLimitedCollector to not fail due to 
+    timeout exceeded (just because test machine is very busy).
 	
 ======================= Release 2.3.2 2008-05-05 =======================
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestTimeLimitedCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestTimeLimitedCollector.java?rev=682619&r1=682618&r2=682619&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestTimeLimitedCollector.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestTimeLimitedCollector.java Tue
Aug  5 00:58:07 2008
@@ -185,12 +185,17 @@
     // a) Not too early
     assertTrue ( "elapsed="+timoutException.getTimeElapsed()+" <= (allowed-resolution)="+(TIME_ALLOWED-TimeLimitedCollector.getResolution()),
         timoutException.getTimeElapsed() > TIME_ALLOWED-TimeLimitedCollector.getResolution());
-    // b) Not too late  (this part might be problematic in a busy system, consider removing
it if it raises false test failures. 
-    assertTrue ( "lastDoc="+exceptionDoc+
+    // b) Not too late.
+    //    This part is problematic in a busy test system, so we just print a warning.
+    //    We already verified that a timeout occurred, we just can't be picky about how long
it took.
+    if (timoutException.getTimeElapsed() > maxTime(multiThreaded)) {
+      System.out.println("Informative: timeout exceeded (no action required: most probably
just " +
+        " because the test machine is slower than usual):  " +
+        "lastDoc="+exceptionDoc+
         " ,&& allowed="+timoutException.getTimeAllowed() +
         " ,&& elapsed="+timoutException.getTimeElapsed() +
-        " >= " + maxTimeStr(multiThreaded),
-        timoutException.getTimeElapsed() < maxTime(multiThreaded));
+        " >= " + maxTimeStr(multiThreaded));
+    }
   }
 
   private long maxTime(boolean multiThreaded) {



Mime
View raw message