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/01/26 11:18:44 UTC

[GitHub] [spark] LuciferYang commented on a change in pull request #31344: [SPARK-34224][CORE][SQL][SS][DSTREAM][YARN][TEST][EXAMPLES][3.0] Ensure all resource opened by `Source.fromXXX` are closed

LuciferYang commented on a change in pull request #31344:
URL: https://github.com/apache/spark/pull/31344#discussion_r564435656



##########
File path: core/src/test/scala/org/apache/spark/deploy/master/MasterSuite.scala
##########
@@ -315,16 +316,17 @@ class MasterSuite extends SparkFunSuite
     val conf = new SparkConf()
     val localCluster = new LocalSparkCluster(2, 2, 512, conf)
     localCluster.start()
+    val masterUrl = s"http://localhost:${localCluster.masterWebUIPort}"
     try {
       eventually(timeout(5.seconds), interval(100.milliseconds)) {
-        val json = Source.fromURL(s"http://localhost:${localCluster.masterWebUIPort}/json")
-          .getLines().mkString("\n")
+        val json = Utils

Review comment:
       Not easy to maintain the same format as the master, so added `masterUrl(line 319) `, any other suggestions @HyukjinKwon 




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