Release agg context in tests part 2#90775
Merged
not-napoleon merged 11 commits intoelastic:mainfrom Oct 11, 2022
Merged
Conversation
Collaborator
|
Pinging @elastic/es-analytics-geo (Team:Analytics) |
nik9000
approved these changes
Oct 10, 2022
| ) { | ||
| return createAggregator(builder, new IndexSearcher(reader), new KeywordFieldType("f")).scoreMode().needsScores(); | ||
| } | ||
| private void needsScores(AggregationBuilder builder, boolean expected) throws IOException { |
Member
There was a problem hiding this comment.
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 |
Member
There was a problem hiding this comment.
"but this test doesn't test things to do with reduction so it should be safe here"
Member
Author
There was a problem hiding this comment.
I just sort of trailed off mid sentence there. Not sure what distracted me.
34 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.