-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[TEST] Limit number of objects created by testMaxNestedDepth #90990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Stop testing that the limit gets hit when the value is the default one, as that causes a lot of objects being created which can cause OOM when executing the test. Instead, added a specific test to verify that the default value is being set appropriately based on its corresponding setting. Closes elastic#90984 Closes elastic#90985 Closes elastic#90986
|
Pinging @elastic/es-search (Team:Search) |
|
|
||
| private static int maxNestedDepth = 20; | ||
| //We set the default value for tests that don't go through SearchModule | ||
| private static int maxNestedDepth = SearchModule.INDICES_MAX_CLAUSE_COUNT_SETTING.getDefault(Settings.EMPTY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
INDICES_MAX_CLAUSE_COUNT_SETTING is 4096, which I don't think is correct.
I think you want INDICES_MAX_NESTED_DEPTH_SETTING here, which has a default value of 30 (changed in #90425)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes indeed, thanks for catching that. 4096 seems a bit high :) luckily this is only for tests. I tried to refactor it because I don't really like the static field and the current logic, but it's not so straight-forward to do.
benwtrent
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just so it's OK that the previous change specifically set maxNestedDepth to 20 when the actual default in the setting was 30. I do not know if that was intentional.
That default value was being overwritten within |
|
Thanks for the review @benwtrent ! |
This commit holds the same change as elastic#90990 but for WrapperQueryBuilderTests, which has special needs and overrides the default impl of the test method Closes elastic#91342
Stop testing that the limit gets hit when the value is the default one, as that causes a lot of objects being created which can cause OOM when executing the test. Instead, added a specific test to verify that the default value is being set appropriately based on its corresponding setting.
Closes #90984
Closes #90985
Closes #90986