opensearch-project / opensearch-project/sql
[TEST] Add a multi-shard integration test CI lane
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 176
- Forks
- 229
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 43
Description
Problem
Integration tests run against one primary shard by default. Queries and assertions that depend on unspecified encounter order can therefore pass in CI but return different results on real multi-shard indices. PR #5730 fixes several examples, and #5716 demonstrates the same class of behavior for FIRST, LAST, and TAKE.
OpenSearch core addresses this behaviorally. OpenSearchIntegTestCase randomizes index shard counts from 1 to 10, and its assertion helpers distinguish ordered results from order-insensitive membership checks. FieldSortIT.testSortDuelBetweenSingleShardAndMultiShardIndex is a concrete single-shard versus multi-shard comparison for sorted top results.
References:
- https://github.com/opensearch-project/OpenSearch/blob/main/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java#L611
- https://github.com/opensearch-project/OpenSearch/blob/main/test/framework/src/main/java/org/opensearch/test/hamcrest/OpenSearchAssertions.java#L263-L307
- https://github.com/opensearch-project/OpenSearch/blob/main/server/src/internalClusterTest/java/org/opensearch/search/sort/FieldSortIT.java#L2036
Proposal
- Add a route-independent
tests.integ.num_shardsoverride inTestUtils.createIndexByRestClientwith a default of 1. - Apply the override only when the index definition does not explicitly set
number_of_shards. - Forward the property through
integTestandintegTestRemote. - Add one Linux CI lane that runs
integTestwith three primary shards. Start it as non-required while existing failures are triaged, then make it required once green.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at TestUtils.createIndexByRestClient and trace how the integTest and integTestRemote tasks pass properties. Compare the referenced OpenSearchIntegTestCase and FieldSortIT examples, then inspect the repository's CI configuration. Done means an opt-in three-primary-shard Linux integTest lane runs successfully without overriding explicit shard counts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ci-cd, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100