cloud-fan opened a new pull request #25243: [SPARK-28498][SQL][TEST] always 
create a fresh copy of the SparkSession before each test
URL: https://github.com/apache/spark/pull/25243
 
 
   ## What changes were proposed in this pull request?
   
   When I write tests, it's tedious to remember to clear all the temporary 
states and write a lot of `withTempView`, `withSQLConf`, etc.
   
   When I review PRs, I also need to keep an eye on the tests and make sure the 
temporary states are cleared, which is extra overhead for me.
   
   I think it can make our life easier if the test framework can create a fresh 
copy of the `SparkSession` before each test.
   
   This PR creates a new trait for test suite: 
`SharedSparkSessionWithFreshCopy`. It's almost the same with 
`SharedSparkSession`, except that it creates a fresh copy of the `SparkSession` 
before each test.
   
   I tried it with `DataSourceV2SQLSuite` and `DataFrameSuite`, and it does 
simplify the test suite.
   
   This is the first step. It's too many changes if we update all the tests in 
one PR. We can do it incrementally by using `SharedSparkSessionWithFreshCopy` 
in more places.
   
   ## How was this patch tested?
   
   test only patch

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to