lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sar...@apache.org
Subject svn commit: r1684919 - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/core/ lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java
Date Thu, 11 Jun 2015 15:30:21 GMT
Author: sarowe
Date: Thu Jun 11 15:30:20 2015
New Revision: 1684919

URL: http://svn.apache.org/r1684919
Log:
LUCENE-6546: Skip Test2BPostingsBytes to avoid OOM with -Dtests.heapsize=30g when codec is-a
CompressingCodec and maxDocsPerChunk * blockSize is less than 16 (merged trunk r1684915)

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/lucene/   (props changed)
    lucene/dev/branches/branch_5x/lucene/core/   (props changed)
    lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java

Modified: lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java?rev=1684919&r1=1684918&r2=1684919&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java
(original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java
Thu Jun 11 15:30:20 2015
@@ -18,10 +18,14 @@ package org.apache.lucene.index;
  */
 
 import java.util.Arrays;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+import org.apache.lucene.codecs.Codec;
+import org.apache.lucene.codecs.compressing.CompressingCodec;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
@@ -39,10 +43,24 @@ import org.apache.lucene.util.LuceneTest
  * @lucene.experimental
  */
 @SuppressCodecs({ "SimpleText", "Memory", "Direct" })
-@Monster("takes ~20GB-30GB of space and 10 minutes, and more heap space sometimes")
+@Monster("takes ~20GB-30GB of space and 10 minutes")
 public class Test2BPostingsBytes extends LuceneTestCase {
 
   public void test() throws Exception {
+    IndexWriterConfig defaultConfig = new IndexWriterConfig(null);
+    Codec defaultCodec = defaultConfig.getCodec();
+    if ((new IndexWriterConfig(null)).getCodec() instanceof CompressingCodec) {
+      Pattern regex = Pattern.compile("maxDocsPerChunk=(\\d+), blockSize=(\\d+)");
+      Matcher matcher = regex.matcher(defaultCodec.toString());
+      assertTrue("Unexpected CompressingCodec toString() output: " + defaultCodec.toString(),
matcher.find());
+      int maxDocsPerChunk = Integer.parseInt(matcher.group(1));
+      int blockSize = Integer.parseInt(matcher.group(2));
+      int product = maxDocsPerChunk * blockSize;
+      assumeTrue(defaultCodec.getName() + " maxDocsPerChunk (" + maxDocsPerChunk
+          + ") * blockSize (" + blockSize + ") < 16 - this can trigger OOM with -Dtests.heapsize=30g",
+          product >= 16);
+    }
+
     BaseDirectoryWrapper dir = newFSDirectory(createTempDir("2BPostingsBytes1"));
     if (dir instanceof MockDirectoryWrapper) {
       ((MockDirectoryWrapper)dir).setThrottling(MockDirectoryWrapper.Throttling.NEVER);



Mime
View raw message