-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Release agg context in tests part 2 #90775
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
Release agg context in tests part 2 #90775
Conversation
|
Pinging @elastic/es-analytics-geo (Team:Analytics) |
| ) { | ||
| return createAggregator(builder, new IndexSearcher(reader), new KeywordFieldType("f")).scoreMode().needsScores(); | ||
| } | ||
| private void needsScores(AggregationBuilder builder, boolean expected) throws IOException { |
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.
Maybe assertNeedsScores so its more obvious this asserts something.
| protected AggregationContext createAggregationContext(IndexSearcher indexSearcher, Query query, MappedFieldType... fieldTypes) | ||
| throws IOException { | ||
| AggregationContext context = super.createAggregationContext(indexSearcher, query, fieldTypes); | ||
| // Generally, we should avoid doing this, but |
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.
"but this test doesn't test things to do with reduction so it should be safe here"
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.
I just sort of trailed off mid sentence there. Not sure what distracted me.
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.
happens
Continues the work from #90540. Turns out we weren't using
MockBigArraysin a whole bunch of places, because the mock didn't correctly wrap overwithCircuitBreakerService(). You can see the corrected version of that method commented out here. It's commented out so that hundreds of tests which are too sloppy with releasing memory don't start failing, but (as noted) I've included it to reduce the chance of future merge conflicts.Besides that, this PR contains several small fixes to aggregations tests to do the right thing with memory. These fixes are harmless to merge independently, and doing so lets us break this work into smaller chunks.