Release agg context in tests part 3#91598
Merged
not-napoleon merged 16 commits intoelastic:mainfrom Nov 17, 2022
Merged
Conversation
Collaborator
|
Pinging @elastic/es-analytics-geo (Team:Analytics) |
nik9000
reviewed
Nov 16, 2022
| aggregator.postCollection(); | ||
| RareTerms result = (RareTerms) aggregator.buildTopLevel(); | ||
|
|
||
| */ |
|
|
||
| Global global = (Global) aggregator.buildTopLevel(); | ||
|
|
||
| */ |
|
|
||
| Max max = (Max) aggregator.buildAggregation(0L); | ||
|
|
||
| */ |
nik9000
approved these changes
Nov 16, 2022
| addToDocument(0, document, createDocument("term-field", "a", "long", 100L)); | ||
| indexWriter.addDocument(document); | ||
| } | ||
| List<Releasable> releasables = new ArrayList<>(); |
Member
There was a problem hiding this comment.
I think we don't put anything in the list other than context - I think it's slightly more normal to declare AggregationContext context = null and then assign something to it and release the context, null or not.
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.
This PR, which is hopefully the last in the aggregations test refactoring saga, enables the fix for
MockBigArrayswhich in turn enables circuit breaker tracking for a lot of aggs tests. Consequentially, it causes a bunch of failures from tests that are doing the wrong thing, so this PR includes fixes for those.In general, I've tried to favor fixing these tests by standardizing them on calling either
AggregatorTestCase#searchAndReduceorAggregatorTestCase#testCase, which have the correct handling for theBigArraysheld byAggregationContext. In some cases, this has not been possible, and I've just released theAggregationContextin a try block within the test. That's less than ideal, but there aren't many tests I've needed to do that for.