Skip to content

Commit

Permalink
randomize test
Browse files Browse the repository at this point in the history
Signed-off-by: panguixin <panguixin@bytedance.com>
  • Loading branch information
bugmakerrrrrr committed Nov 1, 2024
1 parent daf6b01 commit f300e31
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,8 @@ public void testFetchUnsignedLongDocValues() throws IOException {
Directory dir = newDirectory();
IndexWriter w = new IndexWriter(dir, new IndexWriterConfig(null));
Document doc = new Document();
doc.add(new SortedNumericDocValuesField("ul", 10));
final BigInteger expectedValue = randomUnsignedLong();
doc.add(new SortedNumericDocValuesField("ul", expectedValue.longValue()));
w.addDocument(doc);
try (DirectoryReader reader = DirectoryReader.open(w)) {
final NumberFieldType ft = new NumberFieldType("ul", NumberType.UNSIGNED_LONG);
Expand All @@ -1001,7 +1002,7 @@ public void testFetchUnsignedLongDocValues() throws IOException {
assertEquals(1, fetcher.docValueCount());
final Object value = fetcher.nextValue();
assertTrue(value instanceof BigInteger);
assertEquals(BigInteger.valueOf(10), value);
assertEquals(expectedValue, value);
}
IOUtils.close(w, dir);
}
Expand Down

0 comments on commit f300e31

Please sign in to comment.