Skip to content

Apache Lucene open-source search software

don't try to add too many docs in our monster tests

Michael McCandless50b2e81e1ca8
diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BBinaryDocValues.java b/lucene/core/src/test/org/apache/lucene/index/Test2BBinaryDocValues.java
index 598d4ff3682..de8b2c74ca8 100644
--- a/lucene/core/src/test/org/apache/lucene/index/Test2BBinaryDocValues.java
+++ b/lucene/core/src/test/org/apache/lucene/index/Test2BBinaryDocValues.java
@@ -37,7 +37,7 @@ import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
@Monster("takes ~ 45 minutes")
public class Test2BBinaryDocValues extends LuceneTestCase {
- // indexes Integer.MAX_VALUE docs with a fixed binary field
+ // indexes IndexWriter.MAX_DOCS docs with a fixed binary field
public void testFixedBinary() throws Exception {
BaseDirectoryWrapper dir = newFSDirectory(createTempDir("2BFixedBinary"));
if (dir instanceof MockDirectoryWrapper) {
@@ -58,7 +58,7 @@ public class Test2BBinaryDocValues extends LuceneTestCase {
BinaryDocValuesField dvField = new BinaryDocValuesField("dv", data);
doc.add(dvField);
- for (int i = 0; i < Integer.MAX_VALUE; i++) {
+ for (int i = 0; i < IndexWriter.MAX_DOCS; i++) {
bytes[0] = (byte)(i >> 24);
bytes[1] = (byte)(i >> 16);
bytes[2] = (byte)(i >> 8);
@@ -96,7 +96,7 @@ public class Test2BBinaryDocValues extends LuceneTestCase {
dir.close();
}
- // indexes Integer.MAX_VALUE docs with a variable binary field
+ // indexes IndexWriter.MAX_DOCS docs with a variable binary field
public void testVariableBinary() throws Exception {
BaseDirectoryWrapper dir = newFSDirectory(createTempDir("2BVariableBinary"));
if (dir instanceof MockDirectoryWrapper) {
@@ -118,7 +118,7 @@ public class Test2BBinaryDocValues extends LuceneTestCase {
BinaryDocValuesField dvField = new BinaryDocValuesField("dv", data);
doc.add(dvField);
- for (int i = 0; i < Integer.MAX_VALUE; i++) {
+ for (int i = 0; i < IndexWriter.MAX_DOCS; i++) {
encoder.reset(bytes);
encoder.writeVInt(i % 65535); // 1, 2, or 3 bytes
data.length = encoder.getPosition();
diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BNumericDocValues.java b/lucene/core/src/test/org/apache/lucene/index/Test2BNumericDocValues.java
index d9cba8d5c8a..a4d9e3719b0 100644
--- a/lucene/core/src/test/org/apache/lucene/index/Test2BNumericDocValues.java
+++ b/lucene/core/src/test/org/apache/lucene/index/Test2BNumericDocValues.java
@@ -34,7 +34,7 @@ import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
@Monster("takes ~ 30 minutes")
public class Test2BNumericDocValues extends LuceneTestCase {
- // indexes Integer.MAX_VALUE docs with an increasing dv field
+ // indexes IndexWriter.MAX_DOCS docs with an increasing dv field
public void testNumerics() throws Exception {
BaseDirectoryWrapper dir = newFSDirectory(createTempDir("2BNumerics"));
if (dir instanceof MockDirectoryWrapper) {
@@ -53,7 +53,7 @@ public class Test2BNumericDocValues extends LuceneTestCase {
NumericDocValuesField dvField = new NumericDocValuesField("dv", 0);
doc.add(dvField);
- for (int i = 0; i < Integer.MAX_VALUE; i++) {
+ for (int i = 0; i < IndexWriter.MAX_DOCS; i++) {
dvField.setLongValue(i);
w.addDocument(doc);
if (i % 100000 == 0) {
diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java b/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java
index 8260e3d05ed..bea1581ac18 100644
--- a/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java
+++ b/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java
@@ -56,7 +56,7 @@ public class Test2BSortedDocValues extends LuceneTestCase {
SortedDocValuesField dvField = new SortedDocValuesField("dv", data);
doc.add(dvField);
- for (int i = 0; i < Integer.MAX_VALUE; i++) {
+ for (int i = 0; i < IndexWriter.MAX_DOCS; i++) {
bytes[0] = (byte)(i >> 8);
bytes[1] = (byte) i;
w.addDocument(doc);
@@ -111,7 +111,7 @@ public class Test2BSortedDocValues extends LuceneTestCase {
SortedDocValuesField dvField = new SortedDocValuesField("dv", data);
doc.add(dvField);
- for (int i = 0; i < Integer.MAX_VALUE; i++) {
+ for (int i = 0; i < IndexWriter.MAX_DOCS; i++) {
bytes[0] = (byte)(i >> 24);
bytes[1] = (byte)(i >> 16);
bytes[2] = (byte)(i >> 8);