lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r770151 - in /lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask: TestPerfTasksLogic.java tasks/CountingSearchTestTask.java
Date Thu, 30 Apr 2009 10:32:56 GMT
Author: mikemccand
Date: Thu Apr 30 10:32:56 2009
New Revision: 770151

URL: http://svn.apache.org/viewvc?rev=770151&view=rev
Log:
try to prevent false failure of testTimedSearchTask

Modified:
    lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
    lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingSearchTestTask.java

Modified: lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java?rev=770151&r1=770150&r2=770151&view=diff
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
(original)
+++ lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
Thu Apr 30 10:32:56 2009
@@ -116,8 +116,8 @@
     CountingSearchTestTask.numSearches = 0;
     Benchmark benchmark = execBenchmark(algLines);
     assertTrue(CountingSearchTestTask.numSearches > 0);
-    long elapsed = CountingSearchTestTask.lastMillis - CountingSearchTestTask.startMillis;
-    assertTrue("elapsed time was " + elapsed + " msec", elapsed < 2000);
+    long elapsed = CountingSearchTestTask.prevLastMillis - CountingSearchTestTask.startMillis;
+    assertTrue("elapsed time was " + elapsed + " msec", elapsed <= 1500);
   }
 
   public void testHighlighting() throws Exception {

Modified: lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingSearchTestTask.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingSearchTestTask.java?rev=770151&r1=770150&r2=770151&view=diff
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingSearchTestTask.java
(original)
+++ lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingSearchTestTask.java
Thu Apr 30 10:32:56 2009
@@ -27,6 +27,7 @@
   public static int numSearches = 0; 
   public static long startMillis;
   public static long lastMillis;
+  public static long prevLastMillis;
 
   public CountingSearchTestTask(PerfRunData runData) {
     super(runData);
@@ -39,9 +40,11 @@
   }
 
   private static synchronized void incrNumSearches() {
+    prevLastMillis = lastMillis;
     lastMillis = System.currentTimeMillis();
-    if (0 == numSearches)
-      startMillis = lastMillis;
+    if (0 == numSearches) {
+      startMillis = prevLastMillis = lastMillis;
+    }
     numSearches++;
   }
 



Mime
View raw message