Skip to content

Commit 8af5e5b

Browse files
committed
Ensure the tsdb doc values codec is used in ES87TSDBDocValuesFormatTests (#125420)
Ensure `ES87TSDBDocValuesFormat` is used in `ES87TSDBDocValuesFormatTests`'s tests.
1 parent 4b83879 commit 8af5e5b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/src/test/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesFormatTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public void testSortedDocValuesSingleUniqueValue() throws IOException {
5959
try (Directory directory = newDirectory()) {
6060
Analyzer analyzer = new MockAnalyzer(random());
6161
IndexWriterConfig conf = newIndexWriterConfig(analyzer);
62+
conf.setCodec(getCodec());
6263
conf.setMergePolicy(newLogMergePolicy());
6364
try (RandomIndexWriter iwriter = new RandomIndexWriter(random(), directory, conf)) {
6465
for (int i = 0; i < NUM_DOCS; i++) {
@@ -95,6 +96,7 @@ public void testSortedSetDocValuesSingleUniqueValue() throws IOException {
9596
try (Directory directory = newDirectory()) {
9697
Analyzer analyzer = new MockAnalyzer(random());
9798
IndexWriterConfig conf = newIndexWriterConfig(analyzer);
99+
conf.setCodec(getCodec());
98100
conf.setMergePolicy(newLogMergePolicy());
99101
try (RandomIndexWriter iwriter = new RandomIndexWriter(random(), directory, conf)) {
100102
for (int i = 0; i < NUM_DOCS; i++) {
@@ -132,6 +134,7 @@ public void testSortedSetDocValuesSingleUniqueValue() throws IOException {
132134

133135
public void testOneDocManyValues() throws Exception {
134136
IndexWriterConfig config = new IndexWriterConfig();
137+
config.setCodec(getCodec());
135138
try (Directory dir = newDirectory(); IndexWriter writer = new IndexWriter(dir, config)) {
136139
int numValues = 128 + random().nextInt(1024); // > 2^7 to require two blocks
137140
Document d = new Document();
@@ -159,6 +162,7 @@ public void testManyDocsWithManyValues() throws Exception {
159162
final Map<String, long[]> sortedNumbers = new HashMap<>(); // key -> numbers
160163
try (Directory directory = newDirectory()) {
161164
IndexWriterConfig conf = newIndexWriterConfig();
165+
conf.setCodec(getCodec());
162166
try (RandomIndexWriter writer = new RandomIndexWriter(random(), directory, conf)) {
163167
for (int i = 0; i < numDocs; i++) {
164168
Document doc = new Document();

0 commit comments

Comments
 (0)