Skip to content

Conversation

jan-elastic
Copy link
Contributor

fixes: #87240

@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v9.2.0 labels Sep 26, 2025
randomIntBetween(10, 100),
randomLongBetween(1, 10),
randomIntBetween(1, 100),
randomIntBetween(50, 100),
Copy link
Contributor Author

@jan-elastic jan-elastic Sep 26, 2025

Choose a reason for hiding this comment

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

The failing test had a low similarity threshold and two categories that had a matching 3-letter word. This caused these categories to be merged, leading to unexpected results.

With a higher threshold (which is more realistic anyway), this should not happen anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean that the test expects that no categories should ever be merged? If so, this assumption makes the test a little weak, since if none of the aggregations that are being reduced actually do anything, we can't really tell if they're being reduced correctly. For example, I could imagine a bug where instead of correctly combining the aggregators, each just overwrites the previous one, and this test would not be able to detect that, because all of the aggregators have the same behaviour of doing nothing.

It might be difficult to produce a deterministic test case where some of the aggregations actually do combine categories without needing to effectively reimplement the aggregation logic in the test, but as it stands, I'm not sure if this test is actually providing much meaningful coverage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of that is tested in the different other tests in this package.

This test doesn't provide much coverage for categorize text anyway, because random strings generally lead to categories with one string each.

The problem is that the categorize text agg is special, in the sense that it merges / changes keys in the reduce step. No other agg does that (afaik), and the framework isn't compatible with it. In this way, at least some basic properties are verified.

@jan-elastic jan-elastic added :ml Machine learning Team:ML Meta label for the ML team >test Issues or PRs that are addressing/adding tests auto-backport Automatically create backport pull requests when merged v8.19.5 v9.1.5 v8.18.8 v9.0.8 and removed needs:triage Requires assignment of a team area label labels Sep 26, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

Copy link
Contributor

@valeriy42 valeriy42 left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.19
9.1
8.18
9.0

jan-elastic added a commit to jan-elastic/elasticsearch that referenced this pull request Sep 29, 2025
jan-elastic added a commit to jan-elastic/elasticsearch that referenced this pull request Sep 29, 2025
jan-elastic added a commit to jan-elastic/elasticsearch that referenced this pull request Sep 29, 2025
szybia added a commit to szybia/elasticsearch that referenced this pull request Sep 29, 2025
* upstream/main: (22 commits)
  Fix InternalCategorizationAggregationTests.testReduceRandom (elastic#135533)
  [DOCS] GeoIP processor: add clarification about using a reverse proxy endpoint (elastic#135534)
  Move `ProjectRoutingInfo` and related classes (elastic#135586)
  Refactor IndexAbstractionResolver (elastic#135587)
  Simplify returnLocalAll handling in ES|QL (elastic#135353)
  Reapply "Add an option to return early from an allocate call"  (elastic#135589)
  Mute org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT test elastic#134407
  Mute org.elasticsearch.xpack.esql.heap_attack.HeapAttackIT testAggTooManyMvLongs elastic#135585
  Mute org.elasticsearch.multiproject.test.XpackWithMultipleProjectsClientYamlTestSuiteIT test {yaml=esql/60_usage/Basic ESQL usage output (telemetry) snapshot version} elastic#135579
  Mute org.elasticsearch.search.ccs.KnnVectorQueryBuilderCrossClusterSearchIT testKnnQueryWithCcsMinimizeRoundTripsFalse elastic#135573
  Mute org.elasticsearch.xpack.esql.inference.textembedding.TextEmbeddingOperatorTests testSimpleCircuitBreaking elastic#135569
  Add telemetry for `TS` command (elastic#135471)
  Mute org.elasticsearch.cluster.routing.allocation.decider.RestoreInProgressAllocationDeciderTests testCanAllocatePrimaryExistingInRestoreInProgress elastic#135566
  allocation: clarify RestoreInProgressAllocationDecider failure message (elastic#132307)
  [ES|QL] Register AggregateMetricDoubleLiteral (elastic#135054)
  Validate Logstash pipeline ID when creating. (elastic#135378)
  Migrate transport versions 8841050 through 8841041 (elastic#135555)
  Mute org.elasticsearch.search.ccs.SparseVectorQueryBuilderCrossClusterSearchIT testSparseVectorQueryWithCcsMinimizeRoundTripsFalse elastic#135559
  Mute org.elasticsearch.action.admin.cluster.stats.SearchUsageStatsTests testToXContent elastic#135558
  Testing indices query cache memory stats (elastic#135298)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged :ml Machine learning Team:ML Meta label for the ML team >test Issues or PRs that are addressing/adding tests v8.18.8 v8.19.5 v9.0.8 v9.1.5 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] InternalCategorizationAggregationTests testReduceRandom failing
4 participants