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

    https://github.com/apache/spark/pull/23151#discussion_r237746228
  
    --- Diff: 
core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala ---
    @@ -985,37 +985,38 @@ class SparkSubmitSuite
         val hadoopConf = new Configuration()
         updateConfWithFakeS3Fs(hadoopConf)
     
    -    val tmpDir = Utils.createTempDir()
    -    val file = File.createTempFile("tmpFile", "", tmpDir)
    -    val pyFile = File.createTempFile("tmpPy", ".egg", tmpDir)
    -    val mainResource = File.createTempFile("tmpPy", ".py", tmpDir)
    -    val tmpJar = TestUtils.createJarWithFiles(Map("test.resource" -> 
"USER"), tmpDir)
    -    val tmpJarPath = s"s3a://${new File(tmpJar.toURI).getAbsolutePath}"
    +    withTempDir { tmpDir =>
    +      val file = File.createTempFile("tmpFile", "", tmpDir)
    +      val pyFile = File.createTempFile("tmpPy", ".egg", tmpDir)
    +      val mainResource = File.createTempFile("tmpPy", ".py", tmpDir)
    +      val tmpJar = TestUtils.createJarWithFiles(Map("test.resource" -> 
"USER"), tmpDir)
    +      val tmpJarPath = s"s3a://${new File(tmpJar.toURI).getAbsolutePath}"
     
    -    val args = Seq(
    -      "--class", UserClasspathFirstTest.getClass.getName.stripPrefix("$"),
    -      "--name", "testApp",
    -      "--master", "yarn",
    -      "--deploy-mode", "client",
    -      "--jars", tmpJarPath,
    -      "--files", s"s3a://${file.getAbsolutePath}",
    -      "--py-files", s"s3a://${pyFile.getAbsolutePath}",
    -      s"s3a://$mainResource"
    +      val args = Seq(
    +        "--class", 
UserClasspathFirstTest.getClass.getName.stripPrefix("$"),
    +        "--name", "testApp",
    +        "--master", "yarn",
    +        "--deploy-mode", "client",
    +        "--jars", tmpJarPath,
    +        "--files", s"s3a://${file.getAbsolutePath}",
    +        "--py-files", s"s3a://${pyFile.getAbsolutePath}",
    +        s"s3a://$mainResource"
           )
     
    -    val appArgs = new SparkSubmitArguments(args)
    -    val (_, _, conf, _) = submit.prepareSubmitEnvironment(appArgs, conf = 
Some(hadoopConf))
    +      val appArgs = new SparkSubmitArguments(args)
    +      val (_, _, conf, _) = submit.prepareSubmitEnvironment(appArgs, conf 
= Some(hadoopConf))
     
    -    // All the resources should still be remote paths, so that YARN client 
will not upload again.
    -    conf.get("spark.yarn.dist.jars") should be (tmpJarPath)
    --- End diff --
    
    I wouldn't change those spaces alone tho. Let's leave as were.


---

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

Reply via email to