You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2026/05/12 11:52:43 UTC

[PR] [SPARK-XXXXX][SQL][TESTS] Drop redundant BeforeAndAfterEach and SharedSparkSession mixins [spark]

zhengruifeng opened a new pull request, #55819:
URL: https://github.com/apache/spark/pull/55819

   ### What changes were proposed in this pull request?
   
   Two related cleanups in `sql/core` test suites:
   
   1. **Drop redundant `with BeforeAndAfterEach`** (5 files). `SharedSparkSession` transitively mixes in `BeforeAndAfterEach` via `SharedSparkSessionBase`, so listing it again is redundant:
      - `StreamingSourceEvolutionSuite` (the explicit mixin sat after `StreamTest`, which already chains to `SharedSparkSession`)
      - `RocksDBTimestampEncoderOperationsSuite`
      - `ResolveChangelogTableNetChangesTestsBase` (trait)
      - `ResolveChangelogTablePostProcessingSuite`
      - `ResolveChangelogTableStreamingPostProcessingSuite`
   
   2. **Drop redundant `with SharedSparkSession` after `StreamTest`** (5 files). `StreamTest extends SharedSparkSession with TimeLimits`, so listing `SharedSparkSession` again adds nothing:
      - `ForeachWriterSuite`
      - `FileStreamSourceTest` (the abstract base used by `FileStreamSourceSuite` / `FileStreamSourceStressTestSuite`)
      - `TextSocketStreamSuite`
      - `OperatorStateMetadataSuite`
      - `RocksDBCheckpointFailureInjectionSuite`
   
   Unused imports of `org.scalatest.BeforeAndAfterEach` and `org.apache.spark.sql.test.SharedSparkSession` are removed alongside.
   
   Suites that mix in the older `org.scalatest.BeforeAndAfter` (singular, e.g. `ForeachWriterSuite`, `SaveLoadSuite`) keep it - that is a distinct trait with its own `after { ... }` block syntax, not a redundant alias for `BeforeAndAfterEach`. `SaveLoadSuite` is intentionally untouched: its base `DataSourceTest` extends `QueryTest` (not `SharedSparkSession`), so the explicit `with SharedSparkSession` there is load-bearing.
   
   ### Why are the changes needed?
   
   `SharedSparkSession` already extends `QueryTest with SharedSparkSessionBase`, and `SharedSparkSessionBase` already mixes in `BeforeAndAfterEach`. `StreamTest` already extends `SharedSparkSession`. Repeating these in extends clauses adds noise and gives the false impression they are independently required, which makes it easy for the pattern to spread to new suites.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Existing tests; `build/sbt sql/Test/compile` passes cleanly on the affected sources.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-56841][SQL][TESTS] Drop redundant BeforeAndAfterEach and SharedSparkSession mixins [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #55819: [SPARK-56841][SQL][TESTS] Drop redundant BeforeAndAfterEach and SharedSparkSession mixins
URL: https://github.com/apache/spark/pull/55819


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-56841][SQL][TESTS] Drop redundant BeforeAndAfterEach and SharedSparkSession mixins [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #55819:
URL: https://github.com/apache/spark/pull/55819#issuecomment-4446369598

   merged to master/4.x


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org