Skip to content

Conversation

@not-napoleon
Copy link
Member

Continues the work from #90540. Turns out we weren't using MockBigArrays in a whole bunch of places, because the mock didn't correctly wrap over withCircuitBreakerService(). 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.

@not-napoleon not-napoleon added >non-issue >test Issues or PRs that are addressing/adding tests :Analytics/Aggregations Aggregations >tech debt v8.6.0 labels Oct 10, 2022
@not-napoleon not-napoleon requested a review from nik9000 October 10, 2022 20:38
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Oct 10, 2022
@elasticsearchmachine
Copy link
Collaborator

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 {
Copy link
Member

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
Copy link
Member

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"

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

happens

@not-napoleon not-napoleon merged commit 453e7b9 into elastic:main Oct 11, 2022
@not-napoleon not-napoleon deleted the release-agg-context-in-tests-part-2 branch October 11, 2022 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Aggregations Aggregations >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >tech debt >test Issues or PRs that are addressing/adding tests v8.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants