lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r899354 - in /lucene/java/branches/flex_1458_3_0_back_compat_tests: ./ contrib/ contrib/highlighter/src/test/ src/java/org/apache/lucene/search/ src/test/org/apache/lucene/ src/test/org/apache/lucene/analysis/ src/test/org/apache/lucene/doc...
Date Thu, 14 Jan 2010 18:50:08 GMT
Author: uschindler
Date: Thu Jan 14 18:50:07 2010
New Revision: 899354

URL: http://svn.apache.org/viewvc?rev=899354&view=rev
Log:
merge flex backwards branch to rev 893651

Modified:
    lucene/java/branches/flex_1458_3_0_back_compat_tests/   (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/CHANGES.txt   (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/contrib/   (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/contrib/CHANGES.txt   (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/contrib/highlighter/src/test/   (props
changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
  (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestCharArraySet.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
  (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestDateTools.java
  (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestNumberTools.java
  (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestAtomicUpdate.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
  (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestTransactions.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java
  (props changed)

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 14 18:50:07 2010
@@ -2,5 +2,5 @@
 /lucene/java/branches/lucene_2_9:817269-818600,825998,829134,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests:818601-821336
 /lucene/java/branches/lucene_3_0:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/branches/lucene_3_0_back_compat_tests:880869-889631
+/lucene/java/branches/lucene_3_0_back_compat_tests:880869-889631,889909-893651
 /lucene/java/trunk:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 14 18:50:07 2010
@@ -2,5 +2,5 @@
 /lucene/java/branches/lucene_2_9/CHANGES.txt:817269-818600,825998,829134,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/CHANGES.txt:818601-821336
 /lucene/java/branches/lucene_3_0/CHANGES.txt:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/branches/lucene_3_0_back_compat_tests/CHANGES.txt:880869-889631
+/lucene/java/branches/lucene_3_0_back_compat_tests/CHANGES.txt:880869-889631,889909-893651
 /lucene/java/trunk/CHANGES.txt:881213,881315,881466,881819,882374,882464,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 14 18:50:07 2010
@@ -2,5 +2,5 @@
 /lucene/java/branches/lucene_2_9/contrib:817269-818600,825998,829134,829816,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/contrib:818601-821336
 /lucene/java/branches/lucene_3_0/contrib:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/branches/lucene_3_0_back_compat_tests/contrib:880869-889631
+/lucene/java/branches/lucene_3_0_back_compat_tests/contrib:880869-889631,889909-893651
 /lucene/java/trunk/contrib:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/contrib/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 14 18:50:07 2010
@@ -2,5 +2,5 @@
 /lucene/java/branches/lucene_2_9/contrib/CHANGES.txt:817269-818600,825998,826775,829134,829816,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/contrib/CHANGES.txt:818601-821336
 /lucene/java/branches/lucene_3_0/contrib/CHANGES.txt:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/branches/lucene_3_0_back_compat_tests/contrib/CHANGES.txt:880869-889631
+/lucene/java/branches/lucene_3_0_back_compat_tests/contrib/CHANGES.txt:880869-889631,889909-893651
 /lucene/java/trunk/contrib/CHANGES.txt:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/contrib/highlighter/src/test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 14 18:50:07 2010
@@ -2,5 +2,5 @@
 /lucene/java/branches/lucene_2_9/contrib/highlighter/src/test:817269-818600,825998,826775,829134,829816,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/contrib/highlighter/src/test:818601-821336
 /lucene/java/branches/lucene_3_0/contrib/highlighter/src/test:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/branches/lucene_3_0_back_compat_tests/contrib/highlighter/src/test:880869-889631
+/lucene/java/branches/lucene_3_0_back_compat_tests/contrib/highlighter/src/test:880869-889631,889909-893651
 /lucene/java/trunk/contrib/highlighter/src/test:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 14 18:50:07 2010
@@ -2,5 +2,5 @@
 /lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:817269-818600,825998,829134,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:818601-821336
 /lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/branches/lucene_3_0_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:880869-889631
+/lucene/java/branches/lucene_3_0_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:880869-889631,889909-893651
 /lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:881213,881315,881466,881819,881984,882374,882807,882888,882977,883074-883075,885214

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java?rev=899354&r1=899353&r2=899354&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java
Thu Jan 14 18:50:07 2010
@@ -122,7 +122,7 @@
         public void run() {
           Document doc = new Document();
           doc.add(new Field("content", "aaa", Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
-          while(System.currentTimeMillis() < stopTime) {
+          do {
             for(int i=0;i<27;i++) {
               try {
                 writer.addDocument(doc);
@@ -143,7 +143,7 @@
             } catch (InterruptedException ie) {
               throw new ThreadInterruptedException(ie);
             }
-          }
+          } while(System.currentTimeMillis() < stopTime);
         }
       };
 
@@ -151,12 +151,10 @@
 
     // While the above indexing thread is running, take many
     // backups:
-    while(System.currentTimeMillis() < stopTime) {
+    do {
       backupIndex(dir, dp);
       Thread.sleep(20);
-      if (!t.isAlive())
-        break;
-    }
+    } while(t.isAlive());
 
     t.join();
 

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestCharArraySet.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestCharArraySet.java?rev=899354&r1=899353&r2=899354&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestCharArraySet.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestCharArraySet.java
Thu Jan 14 18:50:07 2010
@@ -67,6 +67,7 @@
     assertTrue(set.contains(Integer.valueOf(1)));
   }
   
+  /* clear() is now supported in 3.1, so disable this test in BW
   public void testClear(){
     CharArraySet set=new CharArraySet(10,true);
     set.addAll(Arrays.asList(TEST_STOP_WORDS));
@@ -79,6 +80,7 @@
       assertEquals("Not all words added", TEST_STOP_WORDS.length, set.size());
     }
   }
+  */
   
   public void testModifyOnUnmodifiable(){
     CharArraySet set=new CharArraySet(10,true);

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 14 18:50:07 2010
@@ -1,5 +1,5 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:880869-889631
+/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:880869-889631,889909-893651
 /lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestDateTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 14 18:50:07 2010
@@ -1,5 +1,5 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestDateTools.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestDateTools.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestDateTools.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestDateTools.java:880869-889631
+/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestDateTools.java:880869-889631,889909-893651
 /lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestNumberTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 14 18:50:07 2010
@@ -1,5 +1,5 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestNumberTools.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestNumberTools.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestNumberTools.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestNumberTools.java:880869-889631
+/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestNumberTools.java:880869-889631,889909-893651
 /lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestAtomicUpdate.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestAtomicUpdate.java?rev=899354&r1=899353&r2=899354&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestAtomicUpdate.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestAtomicUpdate.java
Thu Jan 14 18:50:07 2010
@@ -47,7 +47,7 @@
   }
 
   private static abstract class TimedThread extends Thread {
-    boolean failed;
+    volatile boolean failed;
     int count;
     private static float RUN_TIME_SEC = 0.5f;
     private TimedThread[] allThreads;
@@ -65,10 +65,11 @@
       count = 0;
 
       try {
-        while(System.currentTimeMillis() < stopTime && !anyErrors()) {
+        do {
+          if (anyErrors()) break;
           doWork();
           count++;
-        }
+        } while(System.currentTimeMillis() < stopTime);
       } catch (Throwable e) {
         System.out.println(Thread.currentThread().getName() + ": exc");
         e.printStackTrace(System.out);

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 14 18:50:07 2010
@@ -1,5 +1,5 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:880869-889631
+/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:880869-889631,889909-893651
 /lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=899354&r1=899353&r2=899354&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriter.java
Thu Jan 14 18:50:07 2010
@@ -2210,7 +2210,7 @@
       int fullCount = 0;
       final long stopTime = System.currentTimeMillis() + 200;
 
-      while(System.currentTimeMillis() < stopTime) {
+      do {
         try {
           writer.updateDocument(new Term("id", ""+(idUpto++)), doc);
           addCount++;
@@ -2244,7 +2244,7 @@
           }
           break;
         }
-      }
+      } while(System.currentTimeMillis() < stopTime);
     }
   }
 
@@ -2337,6 +2337,12 @@
       fail("did not hit disk full");
     } catch (IOException ioe) {
     }
+
+    // Make sure once disk space is avail again, we can
+    // cleanly close:
+    dir.setMaxSizeInBytes(0);
+    writer.close(false);
+    dir.close();
   }
 
   // LUCENE-1130: make sure immediate disk full on creating
@@ -2372,11 +2378,10 @@
         assertTrue("hit unexpected Throwable", threads[i].error == null);
       }
 
-      try {
-        writer.close(false);
-      } catch (IOException ioe) {
-      }
-
+      // Make sure once disk space is avail again, we can
+      // cleanly close:
+      dir.setMaxSizeInBytes(0);
+      writer.close(false);
       dir.close();
     }
   }

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java?rev=899354&r1=899353&r2=899354&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
Thu Jan 14 18:50:07 2010
@@ -65,7 +65,7 @@
 
       final long stopTime = System.currentTimeMillis() + 500;
 
-      while(System.currentTimeMillis() < stopTime) {
+      do {
         doFail.set(this);
         final String id = ""+r.nextInt(50);
         idField.setValue(id);
@@ -105,7 +105,7 @@
           failure = t;
           break;
         }
-      }
+      } while(System.currentTimeMillis() < stopTime);
     }
   }
 

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java?rev=899354&r1=899353&r2=899354&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
Thu Jan 14 18:50:07 2010
@@ -231,7 +231,7 @@
         numSegments++;
       } else {
         if (upperBound * mergeFactor <= maxMergeDocs) {
-          assertTrue("maxMergeDocs=" + maxMergeDocs + "; numSegments=" + numSegments + ";
upperBound=" + upperBound + "; mergeFactor=" + mergeFactor, numSegments < mergeFactor);
+          assertTrue("maxMergeDocs=" + maxMergeDocs + "; numSegments=" + numSegments + ";
upperBound=" + upperBound + "; mergeFactor=" + mergeFactor + "; segs=" + writer.segString(),
numSegments < mergeFactor);
         }
 
         do {

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java?rev=899354&r1=899353&r2=899354&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexWriterReader.java
Thu Jan 14 18:50:07 2010
@@ -730,14 +730,14 @@
       threads[i] = new Thread() {
           @Override
           public void run() {
-            while(System.currentTimeMillis() < endTime) {
+            do {
               try {
                 writer.addIndexesNoOptimize(dirs);
               } catch (Throwable t) {
                 excs.add(t);
                 throw new RuntimeException(t);
               }
-            }
+            } while(System.currentTimeMillis() < endTime);
           }
         };
       threads[i].setDaemon(true);
@@ -760,6 +760,15 @@
     for(int i=0;i<NUM_THREAD;i++) {
       threads[i].join();
     }
+    // final check
+    IndexReader r2 = r.reopen();
+    if (r2 != r) {
+      r.close();
+      r = r2;
+    }
+    Query q = new TermQuery(new Term("indexname", "test"));
+    final int count = new IndexSearcher(r).search(q, 10).totalHits;
+    assertTrue(count >= lastCount);
 
     assertEquals(0, excs.size());
     writer.close();
@@ -796,7 +805,7 @@
           public void run() {
             int count = 0;
             final Random r = new Random();
-            while(System.currentTimeMillis() < endTime) {
+            do {
               try {
                 for(int i=0;i<10;i++) {
                   writer.addDocument(createDocument(10*count+i, "test", 4));
@@ -811,7 +820,7 @@
                 excs.add(t);
                 throw new RuntimeException(t);
               }
-            }
+            } while(System.currentTimeMillis() < endTime);
           }
         };
       threads[i].setDaemon(true);
@@ -832,7 +841,16 @@
     for(int i=0;i<NUM_THREAD;i++) {
       threads[i].join();
     }
-    assertTrue(sum > 0);
+    // at least search once
+    IndexReader r2 = r.reopen();
+    if (r2 != r) {
+      r.close();
+      r = r2;
+    }
+    Query q = new TermQuery(new Term("indexname", "test"));
+    sum += new IndexSearcher(r).search(q, 10).totalHits;
+
+    assertTrue("no documents found at all", sum > 0);
 
     assertEquals(0, excs.size());
     writer.close();

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing.java?rev=899354&r1=899353&r2=899354&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestStressIndexing.java
Thu Jan 14 18:50:07 2010
@@ -31,7 +31,7 @@
   private Random RANDOM;
 
   private static abstract class TimedThread extends Thread {
-    boolean failed;
+    volatile boolean failed;
     int count;
     private static int RUN_TIME_SEC = 1;
     private TimedThread[] allThreads;
@@ -49,10 +49,11 @@
       count = 0;
 
       try {
-        while(System.currentTimeMillis() < stopTime && !anyErrors()) {
+        do {
+          if (anyErrors()) break;
           doWork();
           count++;
-        }
+        } while(System.currentTimeMillis() < stopTime);
       } catch (Throwable e) {
         System.out.println(Thread.currentThread() + ": exc");
         e.printStackTrace(System.out);

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestTransactions.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestTransactions.java?rev=899354&r1=899353&r2=899354&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestTransactions.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestTransactions.java
Thu Jan 14 18:50:07 2010
@@ -38,7 +38,7 @@
   }
 
   private static abstract class TimedThread extends Thread {
-    boolean failed;
+    volatile boolean failed;
     private static float RUN_TIME_SEC = 0.5f;
     private TimedThread[] allThreads;
 
@@ -53,8 +53,10 @@
       final long stopTime = System.currentTimeMillis() + (long) (1000*RUN_TIME_SEC);
 
       try {
-        while(System.currentTimeMillis() < stopTime && !anyErrors())
+        do {
+          if (anyErrors()) break;
           doWork();
+        } while (System.currentTimeMillis() < stopTime);
       } catch (Throwable e) {
         System.out.println(Thread.currentThread() + ": exc");
         e.printStackTrace(System.out);

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 14 18:50:07 2010
@@ -2,5 +2,5 @@
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/util/TestAttributeSource.java:817269-818600,825998,829134,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java:818601-821336
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/util/TestAttributeSource.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java:880869-889631
+/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java:880869-889631,889909-893651
 /lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,883079,885214



Mime
View raw message