[TEST] Add a multi-shard integration test CI lane

Open
#5,738 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
ci-cd, testing

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.

Description

PPL testing

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:

Proposal

  1. Add a route-independent tests.integ.num_shards override in TestUtils.createIndexByRestClient with a default of 1.
  2. Apply the override only when the index definition does not explicitly set number_of_shards.
  3. Forward the property through integTest and integTestRemote.
  4. Add one Linux CI lane that runs integTest with three primary shards. Start it as non-required while existing failures are triaged, then make it required once green.
Dominant language
Java
Stars
176
Forks
237
Avg merge
2d 12h
Merged PRs (30d)
34

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from opensearch-project/sql

All issues in opensearch-project/sql

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.