Skip to content

Commit 8f72b23

Browse files
authored
Unmute NativeArrayIntegrationTestCase tests (elastic#139192)
I'm unable to reproduce the failure. Somehow the test requested a field didn't exist, which caused a NPE. Unmuting the test and adding more logging in case it fails again in CI. Closes elastic#139153
1 parent 1400cd3 commit 8f72b23

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

muted-tests.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,6 @@ tests:
415415
- class: org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT
416416
method: test {p0=scroll/20_keep_alive/Max keep alive}
417417
issue: https://github.com/elastic/elasticsearch/issues/138680
418-
- class: org.elasticsearch.xpack.unsignedlong.UnsignedLongSyntheticSourceNativeArrayIntegrationTests
419-
method: testSynthesizeArrayRandom
420-
issue: https://github.com/elastic/elasticsearch/issues/138684
421418
- class: org.elasticsearch.xpack.esql.optimizer.LocalLogicalPlanOptimizerTests
422419
method: testAggregateMetricDoubleInlineStats
423420
issue: https://github.com/elastic/elasticsearch/issues/138620
@@ -448,9 +445,9 @@ tests:
448445
- class: org.elasticsearch.xpack.remotecluster.CrossClusterEsqlRCS1EnrichUnavailableRemotesIT
449446
method: testEsqlEnrichWithSkipUnavailable
450447
issue: https://github.com/elastic/elasticsearch/issues/138793
451-
- class: org.elasticsearch.index.mapper.LongSyntheticSourceNativeArrayIntegrationTests
452-
method: testSynthesizeArrayRandom
453-
issue: https://github.com/elastic/elasticsearch/issues/138819
448+
- class: org.elasticsearch.xpack.ilm.actions.DownsampleActionIT
449+
method: testILMWaitsForTimeSeriesEndTimeToLapse
450+
issue: https://github.com/elastic/elasticsearch/issues/138843
454451
- class: org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT
455452
method: test {p0=search/610_function_score/formulating a function score query with a negative number returns bad request}
456453
issue: https://github.com/elastic/elasticsearch/issues/138908

test/framework/src/main/java/org/elasticsearch/index/mapper/NativeArrayIntegrationTestCase.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
package org.elasticsearch.index.mapper;
1111

12+
import org.apache.lucene.index.DirectoryReader;
1213
import org.apache.lucene.index.DocValuesType;
1314
import org.apache.lucene.index.FieldInfo;
1415
import org.apache.lucene.index.FieldInfos;
@@ -313,7 +314,9 @@ protected void verifySyntheticArray(
313314
Set<String> storedFieldNames = new LinkedHashSet<>(document.getFields().stream().map(IndexableField::name).toList());
314315
assertThat(storedFieldNames, contains(expectedStoredFields));
315316
}
316-
var fieldInfo = FieldInfos.getMergedFieldInfos(reader).fieldInfo("field.offsets");
317+
var fieldInfos = getFieldInfos(reader);
318+
var fieldInfo = fieldInfos.fieldInfo("field.offsets");
319+
assertThat(fieldInfo, notNullValue());
317320
assertThat(fieldInfo.getDocValuesType(), equalTo(DocValuesType.SORTED));
318321
}
319322
}
@@ -432,9 +435,18 @@ protected void verifySyntheticArrayInObject(List<Object[]> documents) throws IOE
432435
Set<String> storedFieldNames = new LinkedHashSet<>(document.getFields().stream().map(IndexableField::name).toList());
433436
assertThat(storedFieldNames, contains("_id"));
434437
}
435-
var fieldInfo = FieldInfos.getMergedFieldInfos(reader).fieldInfo("object.field.offsets");
438+
var fieldInfos = getFieldInfos(reader);
439+
var fieldInfo = fieldInfos.fieldInfo("object.field.offsets");
440+
assertThat(fieldInfo, notNullValue());
436441
assertThat(fieldInfo.getDocValuesType(), equalTo(DocValuesType.SORTED));
437442
}
438443
}
439444

445+
private FieldInfos getFieldInfos(DirectoryReader reader) {
446+
var fieldInfos = FieldInfos.getMergedFieldInfos(reader);
447+
for (FieldInfo fieldInfo : fieldInfos) {
448+
logger.info("field name: {}, {}", fieldInfo.name, fieldInfo.attributes());
449+
}
450+
return fieldInfos;
451+
}
440452
}

0 commit comments

Comments
 (0)