opensearch-project / opensearch-project/sql

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

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

Nobody has claimed this yet.

PPL testing
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:

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.

Contributor guide

Open the contributing guide

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.