Skip to content

Modernize cardinality agg tests#90114

Merged
not-napoleon merged 7 commits intoelastic:mainfrom
not-napoleon:modernize-cardinality-agg-tests
Sep 21, 2022
Merged

Modernize cardinality agg tests#90114
not-napoleon merged 7 commits intoelastic:mainfrom
not-napoleon:modernize-cardinality-agg-tests

Conversation

@not-napoleon
Copy link
Copy Markdown
Member

This converts one test in the Cardinality tests to use (a new multi index version of) test case, which will eventually enable better memory accounting testing. It also deletes a second test, which was only verifying that the aggregation context has the correct cache settings - that's not cardinality related, and testing it here is actually a PITA. We're trying to push all aggregation context handling into one path, so we can make sure it's accessed correctly with regards to closing.

@not-napoleon not-napoleon added >test Issues or PRs that are addressing/adding tests :Analytics/Aggregations Aggregations v8.5.0 labels Sep 15, 2022
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Sep 15, 2022
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

assertTrue(AggregationInspectionHelper.hasValue(cardinality));

// Test that an aggregation not using a script does get cached
assertTrue(context.isCacheable());
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This assert is the only thing this test adds over the refactored test above. I don't know where we should be testing that SearchExecutionContext is setting this correctly, but I don't think this is the right place. And having an aggregation context reference at this point is not good. Let's discuss if this test adds enough value that we should re-create it somewhere closer to the code actually being tested.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

I wonder if we should assert that all aggs are cacheable in test-case unless we have some kind of flag.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That seems sensible. I'll try that and see if anything breaks.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So exactly two tests broke, both of which are sorting by a script so it makes sense they shouldn't be cached. With #90149 merged, I am able to communicate that information to the right place in the test framework, with minimal intrusion on the rest of the code. So I think we should be all set here.

@nik9000
Copy link
Copy Markdown
Member

nik9000 commented Sep 20, 2022 via email

@not-napoleon
Copy link
Copy Markdown
Member Author

@elasticmachine update branch

@not-napoleon not-napoleon merged commit 69aa7bb into elastic:main Sep 21, 2022
@not-napoleon not-napoleon deleted the modernize-cardinality-agg-tests branch September 21, 2022 13:29
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Sep 22, 2022
* main: (186 commits)
  [DOCS] Add 8.5 release notes and fix links (elastic#90201)
  Mute DownsampleActionSingleNodeTests.testCannotRollupWhileOtherRollupInProgress (elastic#90198)
  Bump to version 8.6.0
  Increase the minimum size of the management pool to 2 (elastic#90193)
  Speed `getIntLE` from `BytesReference` (elastic#90147)
  Restrict nodes for testClusterPrimariesActive1 (elastic#90191)
  Fix bug with `BigIntArray` serialization (elastic#90142)
  Synthetic _source: test _source filtering (elastic#90138)
  Modernize cardinality agg tests (elastic#90114)
  Mute failing test (elastic#90186)
  Move assertion in ES85BloomFilterPostingsFormat to fix test (elastic#90150)
  Restrict nodes for testClusterPrimariesActive2 (elastic#90184)
  Batch index delete cluster state updates (elastic#90033)
  Register stable plugins in ActionModule (elastic#90067)
  Mute failing test (elastic#90180)
  [HealthAPI] Disk: Use _ for diagnosis id (elastic#90179)
  [HealtAPI] Disk: use shorter help URLs (elastic#90178)
  Fixing disk health indicator unit tests (elastic#90175)
  Enable the health node and the disk health indicator elastic#84811 (elastic#90085)
  Add missing Disk Indicator health api IDs (elastic#90174)
  ...
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Sep 22, 2022
* main: (121 commits)
  [DOCS] Add 8.5 release notes and fix links (elastic#90201)
  Mute DownsampleActionSingleNodeTests.testCannotRollupWhileOtherRollupInProgress (elastic#90198)
  Bump to version 8.6.0
  Increase the minimum size of the management pool to 2 (elastic#90193)
  Speed `getIntLE` from `BytesReference` (elastic#90147)
  Restrict nodes for testClusterPrimariesActive1 (elastic#90191)
  Fix bug with `BigIntArray` serialization (elastic#90142)
  Synthetic _source: test _source filtering (elastic#90138)
  Modernize cardinality agg tests (elastic#90114)
  Mute failing test (elastic#90186)
  Move assertion in ES85BloomFilterPostingsFormat to fix test (elastic#90150)
  Restrict nodes for testClusterPrimariesActive2 (elastic#90184)
  Batch index delete cluster state updates (elastic#90033)
  Register stable plugins in ActionModule (elastic#90067)
  Mute failing test (elastic#90180)
  [HealthAPI] Disk: Use _ for diagnosis id (elastic#90179)
  [HealtAPI] Disk: use shorter help URLs (elastic#90178)
  Fixing disk health indicator unit tests (elastic#90175)
  Enable the health node and the disk health indicator elastic#84811 (elastic#90085)
  Add missing Disk Indicator health api IDs (elastic#90174)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants