You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by si...@apache.org on 2011/04/14 13:40:01 UTC

svn commit: r1092144 - /lucene/dev/branches/realtime_search/lucene/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java

Author: simonw
Date: Thu Apr 14 11:40:00 2011
New Revision: 1092144

URL: http://svn.apache.org/viewvc?rev=1092144&view=rev
Log:
fixing testHealthyness since we now don't stall on bytesUsed explicitly

Modified:
    lucene/dev/branches/realtime_search/lucene/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java

Modified: lucene/dev/branches/realtime_search/lucene/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/realtime_search/lucene/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java?rev=1092144&r1=1092143&r2=1092144&view=diff
==============================================================================
--- lucene/dev/branches/realtime_search/lucene/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java (original)
+++ lucene/dev/branches/realtime_search/lucene/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java Thu Apr 14 11:40:00 2011
@@ -253,14 +253,14 @@ public class TestFlushByRamOrCountsPolic
   public void testHealthyness() throws InterruptedException,
       CorruptIndexException, LockObtainFailedException, IOException {
 
-    int[] numThreads = new int[] { 3 + random.nextInt(8), 1 };
+    int[] numThreads = new int[] { 4 + random.nextInt(8), 1 };
     final int numDocumentsToIndex = 50 + random.nextInt(50);
     for (int i = 0; i < numThreads.length; i++) {
       AtomicInteger numDocs = new AtomicInteger(numDocumentsToIndex);
       MockDirectoryWrapper dir = newDirectory();
       // mock a very slow harddisk here so that flushing is very slow
       dir.setThrottledIndexOutput(new ThrottledIndexOutput(ThrottledIndexOutput
-          .mBitsToBytes(50 + random.nextInt(10)), 5 + random.nextInt(5), null));
+          .mBitsToBytes(40 + random.nextInt(10)), 5 + random.nextInt(5), null));
       IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT,
           new MockAnalyzer(random));
       iwc.setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH);
@@ -290,13 +290,10 @@ public class TestFlushByRamOrCountsPolic
       assertEquals(" all flushes must be due", 0, flushControl.flushBytes());
       assertEquals(numDocumentsToIndex, writer.numDocs());
       assertEquals(numDocumentsToIndex, writer.maxDoc());
-      if (flushControl.peakNetBytes > (long)(iwc.getRAMBufferSizeMB() * 1024d * 1024d * 2d)) {
-        assertTrue("should be unhealthy here numThreads: " + numThreads[i],
+      if (numThreads[i] == 1) {
+        assertFalse(
+            "single thread must not stall",
             docsWriter.healthiness.wasStalled);
-      }
-
-      if (numThreads[i] == 1) { // single thread could be unhealthy is a single
-                                // doc is very large?!
         assertFalse(
             "single thread must not block numThreads: " + numThreads[i],
             docsWriter.healthiness.hasBlocked());