Skip to content

[BUG] Flaky tests in CrossClusterSearchIT due to Calcite-only features #5084

@yuancu

Description

@yuancu

Describe the bug

The CrossClusterSearchIT test class contains tests for PPL commands that are only supported when the Calcite engine is enabled, but the test class does not enable Calcite. Since PPLIntegTestCase.init() calls disableCalcite() by default, these tests will fail or produce incorrect results by falling back to v2.

Affected Tests Using Calcite-Only Commands

The following tests use commands that throw getOnlyForCalciteException in Analyzer.java:

  1. testCrossClusterAddTotals (line 250-259)

    • Uses addtotals command (Calcite-only per Analyzer.java:531)
  2. testCrossClusterAddColTotals (line 261-273)

    • Uses addcoltotals command (Calcite-only per Analyzer.java:536)
  3. testCrossClusterTranspose (line 275-291)

    • Uses transpose command (Calcite-only per Analyzer.java:716)
  4. testCrossClusterAppend (line 293-303)

    • Uses append command (Calcite-only per Analyzer.java:863)
    • Note: Comment on line 295 says "TODO: We should enable calcite by default in CrossClusterSearchIT?"
  5. testCrossClusterMvcombine (line 305-322)

    • Uses mvcombine command (Calcite-only per Analyzer.java:541)

Root Cause

CrossClusterSearchIT extends PPLIntegTestCase, which calls disableCalcite() in its init() method (line 49 of PPLIntegTestCase.java). The test class does not override this behavior by calling enableCalcite().

Code References

  • Test file: integ-test/src/test/java/org/opensearch/sql/security/CrossClusterSearchIT.java
  • Calcite-only exceptions: core/src/main/java/org/opensearch/sql/analysis/Analyzer.java
  • Base test class: integ-test/src/test/java/org/opensearch/sql/ppl/PPLIntegTestCase.java:49

Related CI Run

https://github.com/opensearch-project/sql/actions/runs/21467507458/job/61834137243?pr=4892

OpenSearch Version

Main branch (3.5)

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingflaky-testFlaky build or test issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions