Skip to content

Commit 2ff03ac

Browse files
Fix ignores malformed testcase (#125337)
Fix and unmute testSynthesizeArrayRandomIgnoresMalformed
1 parent e9c4b26 commit 2ff03ac

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,6 @@ tests:
393393
- class: org.elasticsearch.reservedstate.service.ReservedClusterStateServiceTests
394394
method: testProcessMultipleChunks
395395
issue: https://github.com/elastic/elasticsearch/issues/125305
396-
- class: org.elasticsearch.index.mapper.NativeArrayIntegrationTestCase
397-
method: testSynthesizeArrayRandomIgnoresMalformed
398-
issue: https://github.com/elastic/elasticsearch/issues/125319
399396

400397
# Examples:
401398
#

server/src/test/java/org/elasticsearch/index/mapper/NativeArrayIntegrationTestCase.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ public void testSynthesizeArrayRandomIgnoresMalformed() throws Exception {
8383
var expectedDocument = jsonBuilder().startObject();
8484
var inputDocument = jsonBuilder().startObject();
8585

86-
boolean expectedContainsArray = values.length > 0 || malformed.length > 1;
87-
if (expectedContainsArray) {
86+
boolean expectedIsArray = values.length != 0 || malformed.length != 1;
87+
if (expectedIsArray) {
8888
expectedDocument.startArray("field");
89-
} else if (malformed.length > 0) {
89+
} else {
9090
expectedDocument.field("field");
9191
}
9292
inputDocument.startArray("field");
@@ -113,7 +113,7 @@ public void testSynthesizeArrayRandomIgnoresMalformed() throws Exception {
113113
}
114114
}
115115

116-
if (expectedContainsArray) {
116+
if (expectedIsArray) {
117117
expectedDocument.endArray();
118118
}
119119
expectedDocument.endObject();

0 commit comments

Comments
 (0)