mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 14:26:27 +00:00
Fix hang in test for "too many fields" dep. check (#42909)
This commit fixes a rare case where the method to randomly generate a very large mapping could enter an infinite loop.
This commit is contained in:
parent
1f1868a294
commit
e35b240a43
@ -370,7 +370,7 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||
mappingBuilder.startObject("properties");
|
||||
{
|
||||
int subfields = randomIntBetween(1, 10);
|
||||
while (existingFieldNames.size() < subfields) {
|
||||
while (existingFieldNames.size() < subfields && fieldCount.get() <= fieldLimit) {
|
||||
addRandomField(existingFieldNames, fieldLimit, mappingBuilder, fieldCount);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user