2020package org .elasticsearch .common .xcontent ;
2121
2222import com .fasterxml .jackson .core .JsonParseException ;
23-
2423import org .elasticsearch .common .CheckedSupplier ;
2524import org .elasticsearch .common .Strings ;
2625import org .elasticsearch .common .bytes .BytesReference ;
@@ -369,7 +368,6 @@ public void testSubParserObject() throws IOException {
369368 }
370369 }
371370
372- @ AwaitsFix (bugUrl ="https://github.com/elastic/elasticsearch/issues/40617" )
373371 public void testSubParserArray () throws IOException {
374372 XContentBuilder builder = XContentFactory .jsonBuilder ();
375373 int numberOfArrayElements = randomInt (10 );
@@ -378,7 +376,7 @@ public void testSubParserArray() throws IOException {
378376 builder .startArray ();
379377 int numberOfTokens = 0 ;
380378 for (int i = 0 ; i < numberOfArrayElements ; ++i ) {
381- numberOfTokens += generateRandomObjectForMarking (builder );
379+ numberOfTokens += generateRandomObject (builder , 0 );
382380 }
383381 builder .endArray ();
384382 builder .endObject ();
@@ -392,7 +390,7 @@ public void testSubParserArray() throws IOException {
392390 assertEquals (XContentParser .Token .START_ARRAY , parser .nextToken ()); // [
393391 XContentParser subParser = new XContentSubParser (parser );
394392 try {
395- int tokensToSkip = randomInt (numberOfTokens - 1 );
393+ int tokensToSkip = randomInt (numberOfTokens );
396394 for (int i = 0 ; i < tokensToSkip ; i ++) {
397395 // Simulate incomplete parsing
398396 assertNotNull (subParser .nextToken ());
0 commit comments