Spark: Trim TestStructuredStreamingRead3 parameter rows from 8 to 2#16559
Merged
Conversation
Reduces the parameter set in TestStructuredStreamingRead3 from 8 rows
(4 catalogs × async{T,F}) to 2 rows: testhive (async=true) and
testrest (async=false). Streaming read semantics aren't catalog-specific
in any meaningful way, and async-vs-sync planning is the only axis
TestStructuredStreamingRead3 actually exercises beyond basic Spark
streaming behavior. Both async values and the strategic catalog
backends (Hive metastore + REST) remain covered with one row each.
Drops testhadoop (HadoopCatalog isn't recommended for production)
and the spark_catalog SessionCatalog rows (the SessionCatalog wrapper
differences live in DDL/table-resolution paths, not streaming reads).
Each invocation runs 33 streaming tests, so 8→2 rows cuts the class
from 264 to 66 invocations - roughly 75% reduction in CPU time for
this test (the highest-CPU class in the Spark core CI job at 20.3% of
total test CPU).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
this is great! these tests are top contributors of github action wall-time #16397 |
nastra
approved these changes
May 27, 2026
Contributor
Author
|
thanks @nastra and @kevinjqliu for the review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduces
TestStructuredStreamingRead3parameter rows from 8 to 2 in v3.5 / v4.0 / v4.1, dropping the catalogs that don't add meaningful coverage for streaming-read semantics:Removed:
testhadoop(HadoopCatalog isn't recommended for production) andspark_catalog(SessionCatalog wrapper differences live in DDL/table-resolution paths, not streaming reads — bothSparkCatalogandSparkSessionCatalogresolve toSparkTableonce a table is identified as Iceberg, and streaming reads don't exercise the wrapper-specific code paths).The trim cuts each test class invocation count from 264 → 66 (75% reduction).
TestStructuredStreamingRead3was the highest-CPU test class in the Spark core CI job (20.3% of total test CPU on(17, 4.1, 2.13, core), ~931 CPU-sec out of 4595). Per-row coverage analysis shows no test method usesassumeThat(catalogName), so no test gets silenced by the trim — every test still runs across both rows.Axis coverage — before
Axis coverage — after
Both async values still tested; both strategic production catalogs still tested. Joint coverage of
(testhive, false)and(testrest, true)is sacrificed — but no test in the class depends on those joint combinations specifically (noassumeThatoncatalogNameor stacked predicates).Design rationale
SparkTableDSv2 read path, and theIncrementalScanplanning logic. The catalog backend is only involved at table-resolution time. Once the table is loaded, the streaming behavior is the same regardless of catalog.testhadoopdropped.HadoopCatalogisn't a production target for Iceberg. The streaming tests don't exercise anything HadoopCatalog-specific.spark_catalogdropped. TheSparkSessionCatalogwrapper test is more valuable when it exercises code paths the wrapper actually intercepts (DDL routing, V1-vs-V2 fallback for non-Iceberg tables) — none of which streaming reads do.async=false, Hive atasync=true— distributes both async values across both catalogs, no implicit "one catalog runs both async modes" preference.Test plan
spotlessCheckpasses on all 3 Spark versions.TestStructuredStreamingRead3— 66 tests, 0 skipped, 0 failures, 0 errors (down from 264 invocations originally; 75% reduction confirmed).assumeThat(catalogName)—git grep "assumeThat"in the file returned 0 matches, so the catalog axis trim cannot silence any test.🤖 Generated with Claude Code