Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid noisy errors in testSyntheticSourceKeepArrays #114391

Merged
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,7 @@ public void testSyntheticSourceKeepArrays() throws IOException {
b.endObject();
}));

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

@Override
Expand Down