dongjoon-hyun opened a new pull request, #45239:
URL: https://github.com/apache/spark/pull/45239

   ### What changes were proposed in this pull request?
   
   This PR aims to fix `kafka-0-10-sql` to use `ResetSystemProperties` if 
`KafkaTestUtils` is used.
   
   ### Why are the changes needed?
   
   Apache Spark has two `KafkaTestUtils` classes.
   ```
   $ find . -name KafkaTestUtils.scala
   
./connector/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaTestUtils.scala
   
./connector/kafka-0-10/src/test/scala/org/apache/spark/streaming/kafka010/KafkaTestUtils.scala
   ```
   
   `KafkaTestUtils` of `kafka-0-10-sql` uses `System.setProperty` and affects 8 
test suites. We need to use `ResetSystemProperties` to isolate the test cases.
   
   
https://github.com/apache/spark/blob/ee312ecb40ea5b5303fc794a3d494b6f27cda923/connector/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaTestUtils.scala#L290
   
   ```
   $ git grep KafkaTestUtils connector/kafka-0-10-sql | awk -F: '{print $1}' | 
sort | uniq
   connector/kafka-0-10-sql/src/test/resources/log4j2.properties
   
connector/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/ConsumerStrategySuite.scala
   
connector/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaDelegationTokenSuite.scala
   
connector/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaDontFailOnDataLossSuite.scala
   
connector/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchSourceSuite.scala
   
connector/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaOffsetReaderSuite.scala
   
connector/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaRelationSuite.scala
   
connector/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaSinkSuite.scala
   
connector/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaTestUtils.scala
   
connector/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/consumer/KafkaDataConsumerSuite.scala
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. This is a test-only PR.
   
   ### How was this patch tested?
   
   Pass the CIs.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.


-- 
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