Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/997#discussion_r13731671
  
    --- Diff: 
core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala ---
    @@ -272,6 +287,24 @@ class SparkSubmitSuite extends FunSuite with 
ShouldMatchers {
           new File(sparkHome),
           Map("SPARK_TESTING" -> "1", "SPARK_HOME" -> sparkHome))
       }
    +
    +  def forConfDir(defaults: Map[String, String]) (f: String => Unit) = {
    +    val tmpDir = new File("TMP_SPARK_CONF_DIR")
    +    tmpDir.mkdir()
    +
    +    val defaultsConf = new File(tmpDir.getAbsolutePath, 
"spark-defaults.conf")
    +    val writer = new OutputStreamWriter(new FileOutputStream(defaultsConf))
    +    for ((key, value) <- defaults) writer.write(key + " " + value)
    +    writer.flush()
    +    writer.close()
    +
    +    try {
    +      f(tmpDir.getAbsolutePath)
    +    } finally {
    +      defaultsConf.delete()
    --- End diff --
    
    While we're here, this can be one call to `Utils.deleteRecursively(tmpDir)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to