|
9 | 9 |
|
10 | 10 | import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; |
11 | 11 |
|
| 12 | +import com.carrotsearch.randomizedtesting.annotations.Repeat; |
| 13 | + |
| 14 | +import com.carrotsearch.randomizedtesting.annotations.Seed; |
| 15 | + |
12 | 16 | import org.apache.lucene.document.SortedNumericDocValuesField; |
13 | 17 | import org.apache.lucene.index.IndexReader; |
14 | 18 | import org.apache.lucene.index.IndexableField; |
|
63 | 67 | import static org.hamcrest.Matchers.lessThanOrEqualTo; |
64 | 68 | import static org.hamcrest.Matchers.matchesRegex; |
65 | 69 |
|
| 70 | +//@Seed("4FF2CB98F60FD89D:EBBB701671985F2B") |
| 71 | +@Repeat(iterations = 100) |
66 | 72 | public class LuceneSourceOperatorTests extends AnyOperatorTestCase { |
67 | 73 | private static final MappedFieldType S_FIELD = new NumberFieldMapper.NumberFieldType("s", NumberFieldMapper.NumberType.LONG); |
68 | 74 |
|
@@ -211,7 +217,7 @@ private LuceneSourceOperator.Factory simple(DataPartitioning dataPartitioning, i |
211 | 217 | ShardContext ctx = new MockShardContext(reader, 0); |
212 | 218 | Function<ShardContext, List<LuceneSliceQueue.QueryAndTags>> queryFunction = c -> testCase.queryAndExtra(); |
213 | 219 | int maxPageSize = between(10, Math.max(10, numDocs)); |
214 | | - int taskConcurrency = randomIntBetween(1, 4); |
| 220 | + int taskConcurrency = 4; // randomIntBetween(1, 4); NOCOMMIT |
215 | 221 | return new LuceneSourceOperator.Factory( |
216 | 222 | List.of(ctx), |
217 | 223 | queryFunction, |
@@ -262,9 +268,11 @@ private void testSimple(DataPartitioning partitioning) { |
262 | 268 | } |
263 | 269 |
|
264 | 270 | public void testEarlyTermination() { |
265 | | - int numDocs = between(1_000, 20_000); |
266 | | - int limit = between(0, numDocs * 2); |
267 | | - LuceneSourceOperator.Factory factory = simple(randomFrom(DataPartitioning.values()), numDocs, limit, scoring); |
| 271 | + int numDocs = 20_000; //between(1_000, 20_000); NOCOMMIT |
| 272 | + int limit = 100_000; //between(0, numDocs * 2); NOCOMMIT |
| 273 | + LuceneSourceOperator.Factory factory = simple(DataPartitioning.DOC |
| 274 | + // randomFrom(DataPartitioning.values()) NOCOMMIT |
| 275 | + , numDocs, limit, scoring); |
268 | 276 | int taskConcurrency = factory.taskConcurrency(); |
269 | 277 | final AtomicInteger receivedRows = new AtomicInteger(); |
270 | 278 | List<Driver> drivers = new ArrayList<>(); |
@@ -293,6 +301,13 @@ public void testEarlyTermination() { |
293 | 301 | drivers.add(driver); |
294 | 302 | } |
295 | 303 | OperatorTestCase.runDriver(drivers); |
| 304 | + logger.info( |
| 305 | + "{} received={} limit={} numResults={}", |
| 306 | + factory.dataPartitioning, |
| 307 | + receivedRows.get(), |
| 308 | + limit, |
| 309 | + testCase.numResults(numDocs) |
| 310 | + ); |
296 | 311 | assertThat(receivedRows.get(), equalTo(Math.min(limit, testCase.numResults(numDocs)))); |
297 | 312 | } |
298 | 313 |
|
|
0 commit comments