Unmute and fix testSubParserArray (#40626)
testSubParserArray failed, fixed and improved to not always have an object as outer-level inside array. Closes #40617
This commit is contained in:
parent
92d07e9377
commit
14ee3d3f95
|
@ -376,7 +376,7 @@ public class XContentParserTests extends ESTestCase {
|
|||
builder.startArray();
|
||||
int numberOfTokens = 0;
|
||||
for (int i = 0; i < numberOfArrayElements; ++i) {
|
||||
numberOfTokens += generateRandomObjectForMarking(builder);
|
||||
numberOfTokens += generateRandomObject(builder, 0);
|
||||
}
|
||||
builder.endArray();
|
||||
builder.endObject();
|
||||
|
@ -390,7 +390,7 @@ public class XContentParserTests extends ESTestCase {
|
|||
assertEquals(XContentParser.Token.START_ARRAY, parser.nextToken()); // [
|
||||
XContentParser subParser = new XContentSubParser(parser);
|
||||
try {
|
||||
int tokensToSkip = randomInt(numberOfTokens - 1);
|
||||
int tokensToSkip = randomInt(numberOfTokens);
|
||||
for (int i = 0; i < tokensToSkip; i++) {
|
||||
// Simulate incomplete parsing
|
||||
assertNotNull(subParser.nextToken());
|
||||
|
|
Loading…
Reference in New Issue