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
- Add a route-independent
tests.integ.num_shards override in TestUtils.createIndexByRestClient with a default of 1.
- Apply the override only when the index definition does not explicitly set
number_of_shards.
- Forward the property through
integTest and integTestRemote.
- 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.
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.
OpenSearchIntegTestCaserandomizes index shard counts from 1 to 10, and its assertion helpers distinguish ordered results from order-insensitive membership checks.FieldSortIT.testSortDuelBetweenSingleShardAndMultiShardIndexis a concrete single-shard versus multi-shard comparison for sorted top results.References:
Proposal
tests.integ.num_shardsoverride inTestUtils.createIndexByRestClientwith a default of 1.number_of_shards.integTestandintegTestRemote.integTestwith three primary shards. Start it as non-required while existing failures are triaged, then make it required once green.