apache / apache/lucene

Improve LuceneTestCase.defaultCodecSupportsDocsWithField to check the actual DocValuesFormat used per-field [LUCENE-5199]

Open
#6,263 16 comments 0 reactions 1 assignee Claimed by @shaie View on GitHub
legacy-jira-fix-version:4.9 legacy-jira-fix-version:6.0 legacy-jira-priority:Major type:enhancement type:test
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

On #6242 Han reported the following test failure:

```
[junit4] FAILURE 0.27s | TestRangeAccumulator.testMissingValues <<<
[junit4] > Throwable #1: org.junit.ComparisonFailure: expected:<...(0)
[junit4] > less than 10 ([8)
[junit4] > less than or equal to 10 (]8)
[junit4] > over 90 (8)
[junit4] > 9...> but was:<...(0)
[junit4] > less than 10 ([28)
[junit4] > less than or equal to 10 (2]8)
[junit4] > over 90 (8)
[junit4] > 9...>
[junit4] > at __randomizedtesting.SeedInfo.seed([815B6AA86D05329C:EBC638EE498F066D]:0)
[junit4] > at org.apache.lucene.facet.range.TestRangeAccumulator.testMissingValues(TestRangeAccumulator.java:670)
[junit4] > at java.lang.Thread.run(Thread.java:722)
```

which can be reproduced with

```
tcase=TestRangeAccumulator -Dtests.method=testMissingValues -Dtests.seed=815B6AA86D05329C -Dtests.slow=true -Dtests.postingsformat=Lucene41 -Dtests.locale=ca -Dtests.timezone=Australia/Currie -Dtests.file.encoding=UTF-8
```

It seems that the Codec that is picked is a Lucene45Codec with Lucene42DVFormat, which does not support docsWithFields for numericDV. We should improve LTC.defaultCodecSupportsDocsWithField to take a list of fields and check that the actual DVF used for each field supports it.

---
Migrated from [LUCENE-5199](https://issues.apache.org/jira/browse/LUCENE-5199) by Shai Erera (@shaie), updated May 09 2016
Attachments: [LUCENE-5199.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-5199/LUCENE-5199.patch), [LUENE-5199.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-5199/LUENE-5199.patch)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.