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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to