Skip to content

ESQL: Add spec-driven distributed integration tests for external sources#143336

Merged
costin merged 7 commits intoelastic:mainfrom
costin:ws-d/distributed-integration-tests
Mar 1, 2026
Merged

ESQL: Add spec-driven distributed integration tests for external sources#143336
costin merged 7 commits intoelastic:mainfrom
costin:ws-d/distributed-integration-tests

Conversation

@costin
Copy link
Copy Markdown
Member

@costin costin commented Feb 28, 2026

External source distributed execution has no end-to-end test coverage — existing tests only assert plan structure at the unit level. There is no verification that different distribution strategies produce identical results when running the same query.

This adds a multi-node integration test that runs the same csv-spec queries across all three distribution strategies (coordinator_only, round_robin, adaptive) and asserts identical results. Any divergence immediately flags a split assignment, exchange, or aggregation bug.

The test uses a 3-node cluster with S3/GCS fixtures and cross-products the existing external-basic.csv-spec tests with all storage backends and distribution modes.

Part of #143330

Developed using AI-assisted tooling

External source distributed execution has no end-to-end test coverage.
Existing tests only assert plan structure at the unit level. This adds
a multi-node integration test that runs the same csv-spec queries across
all three distribution strategies (coordinator_only, round_robin, adaptive)
and asserts identical results — any divergence flags a split assignment,
exchange, or aggregation bug.

- multi-node build.gradle: add S3/GCS fixtures, datasource plugins
- ExternalDistributedClusters: 3-node cluster with S3 fixture wiring
- ExternalDistributedSpecIT: parameterized test runner cross-producting
  external-basic specs with storage backends and distribution modes

Developed using AI-assisted tooling
@costin costin added >test Issues or PRs that are addressing/adding tests Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL ES|QL|DS ES|QL datasources labels Feb 28, 2026
@costin costin requested a review from bpintea February 28, 2026 13:12
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

costin added a commit to costin/elasticsearch that referenced this pull request Feb 28, 2026
Randomized tests that verify mathematical invariants of the split
assignment algorithm: every split assigned exactly once, bounded load
imbalance (no node exceeds ceil(splits/nodes)), deterministic output,
and correct behavior at boundary conditions (single split, zero nodes,
more nodes than splits).

Builds on PR-D1 (elastic#143336) distributed integration test infrastructure.

- ExternalDistributionPropertyTests: 11 property-based tests covering
  RoundRobinStrategy, AdaptiveStrategy, and CoordinatorOnlyStrategy

Developed using AI-assisted tooling
@costin costin force-pushed the ws-d/distributed-integration-tests branch from b8b584e to 4e2f5e7 Compare February 28, 2026 18:46
@costin costin enabled auto-merge (squash) February 28, 2026 20:43
When test resources (iceberg-fixtures) are bundled inside a JAR by the
internal-test-artifact plugin, the existing code asserted file: protocol
URLs and failed. Expand S3FixtureUtils and AbstractExternalSourceSpecTestCase
to enumerate and load fixtures from both filesystem and JAR sources.

- S3FixtureUtils: added forEachFixtureEntry() and resolveLocalFixturesPath()
  utilities; loadFixturesFromResources() now dispatches to loadFixturesFromJar()
- AbstractExternalSourceSpecTestCase: loadGcsFixtures(), generateCompressedFixtures(),
  resolveLocalFixturesPath() now use the shared utility instead of direct file walks

Developed using AI-assisted tooling
@costin costin force-pushed the ws-d/distributed-integration-tests branch from 4e2f5e7 to fd9ddae Compare February 28, 2026 20:44
costin added 4 commits March 1, 2026 09:25
When test resources are bundled inside a JAR (CI), there is no
filesystem path for the LOCAL storage backend. Exclude LOCAL from
the test matrix when resolveLocalFixturesPath returns null. Also
filter Azure SDK reactor-netty thread leaks in the distributed
integration test suite.

- AbstractExternalSourceSpecTestCase: BACKENDS list now computed
  at class-load time, excluding LOCAL when fixtures are in a JAR
- ExternalDistributedSpecIT: added AzureReactorThreadFilter for
  reactor-http-nio and boundedElastic threads from Azure SDK

Developed using AI-assisted tooling
ExternalDistributedClusters called ElasticsearchCluster.local().nodes(3)
directly, which fails in serverless mode where changing the node count
is not supported. Delegate to Clusters.testCluster() — the same pattern
used by all other multi-node tests — so the serverless infrastructure
can substitute its own cluster builder.

- ExternalDistributedClusters: delegate to Clusters.testCluster()

Developed using AI-assisted tooling
In serverless mode the datasource connector plugins (esql-datasource-s3,
esql-datasource-gcs, etc.) are not installed, causing "Unsupported
storage scheme" errors. Add a runtime probe that detects missing
connectors and skips the test via assumeTrue.

- ExternalDistributedSpecIT: override shouldSkipTest with connector check

Developed using AI-assisted tooling
@costin costin merged commit 4914b28 into elastic:main Mar 1, 2026
35 checks passed
@costin costin deleted the ws-d/distributed-integration-tests branch March 1, 2026 18:19
costin added a commit that referenced this pull request Mar 1, 2026
* ESQL: Add spec-driven distributed integration tests for external sources

External source distributed execution has no end-to-end test coverage.
Existing tests only assert plan structure at the unit level. This adds
a multi-node integration test that runs the same csv-spec queries across
all three distribution strategies (coordinator_only, round_robin, adaptive)
and asserts identical results — any divergence flags a split assignment,
exchange, or aggregation bug.

- multi-node build.gradle: add S3/GCS fixtures, datasource plugins
- ExternalDistributedClusters: 3-node cluster with S3 fixture wiring
- ExternalDistributedSpecIT: parameterized test runner cross-producting
  external-basic specs with storage backends and distribution modes

Developed using AI-assisted tooling

* ESQL: Add distribution property tests for external sources

Randomized tests that verify mathematical invariants of the split
assignment algorithm: every split assigned exactly once, bounded load
imbalance (no node exceeds ceil(splits/nodes)), deterministic output,
and correct behavior at boundary conditions (single split, zero nodes,
more nodes than splits).

Builds on PR-D1 (#143336) distributed integration test infrastructure.

- ExternalDistributionPropertyTests: 11 property-based tests covering
  RoundRobinStrategy, AdaptiveStrategy, and CoordinatorOnlyStrategy

Developed using AI-assisted tooling

* ESQL: Handle JAR-packaged fixture resources in tests

When test resources (iceberg-fixtures) are bundled inside a JAR by the
internal-test-artifact plugin, the existing code silently skipped loading
or asserted file: protocol URLs and failed. Expand S3FixtureUtils and
AbstractExternalSourceSpecTestCase to enumerate and load fixtures from
both filesystem and JAR sources.

- S3FixtureUtils: added forEachFixtureEntry() and resolveLocalFixturesPath()
  utilities; loadFixturesFromResources() now dispatches to loadFixturesFromJar()
- AbstractExternalSourceSpecTestCase: loadGcsFixtures(), generateCompressedFixtures(),
  resolveLocalFixturesPath() now use the shared utility instead of direct file walks

Developed using AI-assisted tooling

* ESQL: Skip LOCAL backend tests when fixtures are JAR-packaged

When test resources are bundled inside a JAR (CI), there is no
filesystem path for the LOCAL storage backend. Exclude LOCAL from
the test matrix when resolveLocalFixturesPath returns null. Also
filter Azure SDK reactor-netty thread leaks in the distributed
integration test suite.

- AbstractExternalSourceSpecTestCase: BACKENDS list now computed
  at class-load time, excluding LOCAL when fixtures are in a JAR
- ExternalDistributedSpecIT: added AzureReactorThreadFilter for
  reactor-http-nio and boundedElastic threads from Azure SDK

Developed using AI-assisted tooling

* ESQL: Use Clusters.testCluster for distributed tests

ExternalDistributedClusters called ElasticsearchCluster.local().nodes(3)
directly, which fails in serverless mode where changing the node count
is not supported. Delegate to Clusters.testCluster() — the same pattern
used by all other multi-node tests — so the serverless infrastructure
can substitute its own cluster builder.

- ExternalDistributedClusters: delegate to Clusters.testCluster()

Developed using AI-assisted tooling

* ESQL: Skip external distributed tests when connectors unavailable

In serverless mode the datasource connector plugins (esql-datasource-s3,
esql-datasource-gcs, etc.) are not installed, causing "Unsupported
storage scheme" errors. Add a runtime probe that detects missing
connectors and skips the test via assumeTrue.

- ExternalDistributedSpecIT: override shouldSkipTest with connector check

Developed using AI-assisted tooling

* ESQL: Address review feedback on distributed tests

- ExternalDistributedClusters: use System.getProperty("java.io.tmpdir")
  instead of hardcoded "/tmp" for the fixtures path fallback
- ExternalDistributedSpecIT: reuse framework AzureReactorThreadFilter,
  keep a small AzureSdkThreadFilter for the extra "azure-sdk-" prefix

Developed using AI-assisted tooling
tballison pushed a commit to tballison/elasticsearch that referenced this pull request Mar 3, 2026
…ces (elastic#143336)

External source distributed execution has no end-to-end test coverage — existing tests only assert plan structure at the unit level. There is no verification that different distribution strategies produce identical results when running the same query.

This adds a multi-node integration test that runs the same csv-spec queries across all three distribution strategies (coordinator_only, round_robin, adaptive) and asserts identical results. Any divergence immediately flags a split assignment, exchange, or aggregation bug.

The test uses a 3-node cluster with S3/GCS fixtures and cross-products the existing `external-basic.csv-spec` tests with all storage backends and distribution modes.

Part of elastic#143330

Developed using AI-assisted tooling
tballison pushed a commit to tballison/elasticsearch that referenced this pull request Mar 3, 2026
…43341)

* ESQL: Add spec-driven distributed integration tests for external sources

External source distributed execution has no end-to-end test coverage.
Existing tests only assert plan structure at the unit level. This adds
a multi-node integration test that runs the same csv-spec queries across
all three distribution strategies (coordinator_only, round_robin, adaptive)
and asserts identical results — any divergence flags a split assignment,
exchange, or aggregation bug.

- multi-node build.gradle: add S3/GCS fixtures, datasource plugins
- ExternalDistributedClusters: 3-node cluster with S3 fixture wiring
- ExternalDistributedSpecIT: parameterized test runner cross-producting
  external-basic specs with storage backends and distribution modes

Developed using AI-assisted tooling

* ESQL: Add distribution property tests for external sources

Randomized tests that verify mathematical invariants of the split
assignment algorithm: every split assigned exactly once, bounded load
imbalance (no node exceeds ceil(splits/nodes)), deterministic output,
and correct behavior at boundary conditions (single split, zero nodes,
more nodes than splits).

Builds on PR-D1 (elastic#143336) distributed integration test infrastructure.

- ExternalDistributionPropertyTests: 11 property-based tests covering
  RoundRobinStrategy, AdaptiveStrategy, and CoordinatorOnlyStrategy

Developed using AI-assisted tooling

* ESQL: Handle JAR-packaged fixture resources in tests

When test resources (iceberg-fixtures) are bundled inside a JAR by the
internal-test-artifact plugin, the existing code silently skipped loading
or asserted file: protocol URLs and failed. Expand S3FixtureUtils and
AbstractExternalSourceSpecTestCase to enumerate and load fixtures from
both filesystem and JAR sources.

- S3FixtureUtils: added forEachFixtureEntry() and resolveLocalFixturesPath()
  utilities; loadFixturesFromResources() now dispatches to loadFixturesFromJar()
- AbstractExternalSourceSpecTestCase: loadGcsFixtures(), generateCompressedFixtures(),
  resolveLocalFixturesPath() now use the shared utility instead of direct file walks

Developed using AI-assisted tooling

* ESQL: Skip LOCAL backend tests when fixtures are JAR-packaged

When test resources are bundled inside a JAR (CI), there is no
filesystem path for the LOCAL storage backend. Exclude LOCAL from
the test matrix when resolveLocalFixturesPath returns null. Also
filter Azure SDK reactor-netty thread leaks in the distributed
integration test suite.

- AbstractExternalSourceSpecTestCase: BACKENDS list now computed
  at class-load time, excluding LOCAL when fixtures are in a JAR
- ExternalDistributedSpecIT: added AzureReactorThreadFilter for
  reactor-http-nio and boundedElastic threads from Azure SDK

Developed using AI-assisted tooling

* ESQL: Use Clusters.testCluster for distributed tests

ExternalDistributedClusters called ElasticsearchCluster.local().nodes(3)
directly, which fails in serverless mode where changing the node count
is not supported. Delegate to Clusters.testCluster() — the same pattern
used by all other multi-node tests — so the serverless infrastructure
can substitute its own cluster builder.

- ExternalDistributedClusters: delegate to Clusters.testCluster()

Developed using AI-assisted tooling

* ESQL: Skip external distributed tests when connectors unavailable

In serverless mode the datasource connector plugins (esql-datasource-s3,
esql-datasource-gcs, etc.) are not installed, causing "Unsupported
storage scheme" errors. Add a runtime probe that detects missing
connectors and skips the test via assumeTrue.

- ExternalDistributedSpecIT: override shouldSkipTest with connector check

Developed using AI-assisted tooling

* ESQL: Address review feedback on distributed tests

- ExternalDistributedClusters: use System.getProperty("java.io.tmpdir")
  instead of hardcoded "/tmp" for the fixtures path fallback
- ExternalDistributedSpecIT: reuse framework AzureReactorThreadFilter,
  keep a small AzureSdkThreadFilter for the extra "azure-sdk-" prefix

Developed using AI-assisted tooling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL ES|QL|DS ES|QL datasources Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants