Skip to content

Commit f6bf506

Browse files
authored
Avoid noisy errors in testSyntheticSourceKeepArrays (#114391)
* Minimize storing array source * restrict to fields * revert changes for `addIgnoredFieldFromContext` * fix test * spotless * count nulls * Avoid noisy errors in testSyntheticSourceKeepArrays * update * update * update * update
1 parent e97aaa8 commit f6bf506

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,7 @@ public void testSyntheticSourceKeepArrays() throws IOException {
15701570
b.endObject();
15711571
}));
15721572

1573-
int elementCount = randomIntBetween(1, 5);
1573+
int elementCount = randomIntBetween(2, 5);
15741574
CheckedConsumer<XContentBuilder, IOException> buildInput = (XContentBuilder builder) -> {
15751575
example.buildInputArray(builder, elementCount);
15761576
};
@@ -1581,10 +1581,7 @@ public void testSyntheticSourceKeepArrays() throws IOException {
15811581
builder.endObject();
15821582
String expected = Strings.toString(builder);
15831583
String actual = syntheticSource(mapperAll, buildInput);
1584-
// Check for single-element array, the array source is not stored in this case.
1585-
if (expected.replace("[", "").replace("]", "").equals(actual) == false) {
1586-
assertThat(actual, equalTo(expected));
1587-
}
1584+
assertThat(actual, equalTo(expected));
15881585
}
15891586

15901587
@Override

0 commit comments

Comments
 (0)