Skip to content

Commit

Permalink
Reduce num docs in ValuesSourceReaderOperatorTests (#100469)
Browse files Browse the repository at this point in the history
The test failed because it took more than 30 seconds to extract fields 
for approximately 100,000 documents. With the randomized page size, we
can make these tests more reliable and faster by reducing the number of
documents.

Closes #100235
  • Loading branch information
dnhatn authored Oct 9, 2023
1 parent cb1e901 commit a12195c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void testLoadAll() {
DriverContext driverContext = driverContext();
loadSimpleAndAssert(
driverContext,
CannedSourceOperator.collectPages(simpleInput(driverContext.blockFactory(), between(1_000, 100 * 1024)))
CannedSourceOperator.collectPages(simpleInput(driverContext.blockFactory(), between(100, 5000)))
);
}

Expand All @@ -212,7 +212,7 @@ public void testLoadAllInOnePage() {
driverContext,
List.of(
CannedSourceOperator.mergePages(
CannedSourceOperator.collectPages(simpleInput(driverContext.blockFactory(), between(1_000, 100 * 1024)))
CannedSourceOperator.collectPages(simpleInput(driverContext.blockFactory(), between(100, 5000)))
)
)
);
Expand All @@ -226,7 +226,7 @@ public void testEmpty() {
public void testLoadAllInOnePageShuffled() {
DriverContext driverContext = driverContext();
Page source = CannedSourceOperator.mergePages(
CannedSourceOperator.collectPages(simpleInput(driverContext.blockFactory(), between(1_000, 100 * 1024)))
CannedSourceOperator.collectPages(simpleInput(driverContext.blockFactory(), between(100, 5000)))
);
List<Integer> shuffleList = new ArrayList<>();
IntStream.range(0, source.getPositionCount()).forEach(i -> shuffleList.add(i));
Expand Down Expand Up @@ -384,7 +384,7 @@ public void testValuesSourceReaderOperatorWithNulls() throws IOException {
NumericDocValuesField intField = new NumericDocValuesField(intFt.name(), 0);
NumericDocValuesField longField = new NumericDocValuesField(longFt.name(), 0);
NumericDocValuesField doubleField = new DoubleDocValuesField(doubleFt.name(), 0);
final int numDocs = 100_000;
final int numDocs = between(100, 5000);
try (RandomIndexWriter w = new RandomIndexWriter(random(), directory)) {
Document doc = new Document();
for (int i = 0; i < numDocs; i++) {
Expand Down

0 comments on commit a12195c

Please sign in to comment.