Fix ignores malformed testcase (#125337)

Fix and unmute testSynthesizeArrayRandomIgnoresMalformed
This commit is contained in:
Jordan Powers 2025-03-20 15:31:38 -07:00 committed by GitHub
parent e9c4b267c2
commit 2ff03acf51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 7 deletions

View file

@ -393,9 +393,6 @@ tests:
- class: org.elasticsearch.reservedstate.service.ReservedClusterStateServiceTests
method: testProcessMultipleChunks
issue: https://github.com/elastic/elasticsearch/issues/125305
- class: org.elasticsearch.index.mapper.NativeArrayIntegrationTestCase
method: testSynthesizeArrayRandomIgnoresMalformed
issue: https://github.com/elastic/elasticsearch/issues/125319
# Examples:
#

View file

@ -83,10 +83,10 @@ public abstract class NativeArrayIntegrationTestCase extends ESSingleNodeTestCas
var expectedDocument = jsonBuilder().startObject();
var inputDocument = jsonBuilder().startObject();
boolean expectedContainsArray = values.length > 0 || malformed.length > 1;
if (expectedContainsArray) {
boolean expectedIsArray = values.length != 0 || malformed.length != 1;
if (expectedIsArray) {
expectedDocument.startArray("field");
} else if (malformed.length > 0) {
} else {
expectedDocument.field("field");
}
inputDocument.startArray("field");
@ -113,7 +113,7 @@ public abstract class NativeArrayIntegrationTestCase extends ESSingleNodeTestCas
}
}
if (expectedContainsArray) {
if (expectedIsArray) {
expectedDocument.endArray();
}
expectedDocument.endObject();