You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/02/08 01:26:31 UTC

[GitHub] [spark] yaooqinn commented on a change in pull request #31515: [SPARK-34346][CORE][TESTS][FOLLOWUP] Fix UT by removing core-site.xml

yaooqinn commented on a change in pull request #31515:
URL: https://github.com/apache/spark/pull/31515#discussion_r571735273



##########
File path: core/src/test/scala/org/apache/spark/SparkContextSuite.scala
##########
@@ -1155,11 +1155,12 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext with Eventu
     val testKey = "hadoop.tmp.dir"
     val bufferKey = "io.file.buffer.size"
     val hadoopConf0 = new Configuration()
+    hadoopConf0.set(testKey, "/tmp/hive_zero")
 
     val hiveConfFile = Utils.getContextOrSparkClassLoader.getResource("hive-site.xml")
     assert(hiveConfFile != null)
     hadoopConf0.addResource(hiveConfFile)
-    assert(hadoopConf0.get(testKey) === "/tmp/hive_one")
+    assert(hadoopConf0.get(testKey) === "/tmp/hive_zero")

Review comment:
       w/ this change, `"/tmp/hive_one"` in `hive-site.xml` overlays `"/tmp/hive_{user}"` not  `"/tmp/hive_zero"`, which happens in `SparkHadoopUtil.appendS3AndSparkHadoopHiveConfigurations`.
   
   As `hadoopConf0` is not passed to `SparkHadoopUtil`, while `core-site.xml` is, so here to reduce test flakiness, we can remove those `assert`s for `hadoopConf0`, as they are just used to check `hive-site.xml` overrides `core-site.xml`. 




----------------------------------------------------------------
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:
users@infra.apache.org



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