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

    https://github.com/apache/spark/pull/13950#discussion_r74840528
  
    --- Diff: 
core/src/test/scala/org/apache/spark/deploy/master/MasterSuite.scala ---
    @@ -157,6 +157,34 @@ class MasterSuite extends SparkFunSuite
         }
       }
     
    +  test("master/worker web ui available with reverseProxy") {
    +    implicit val formats = org.json4s.DefaultFormats
    +    val reverseProxyUrl = "http://localhost:8080";
    +    val conf = new SparkConf()
    +    conf.set("spark.ui.reverseProxy", "true")
    +    conf.set("spark.ui.reverseProxyUrl", reverseProxyUrl)
    +    val localCluster = new LocalSparkCluster(2, 2, 512, conf)
    +    localCluster.start()
    +    try {
    +      eventually(timeout(5 seconds), interval(100 milliseconds)) {
    +        val json = 
Source.fromURL(s"http://localhost:${localCluster.masterWebUIPort}/json";)
    +          .getLines().mkString("\n")
    +        val JArray(workers) = (parse(json) \ "workers")
    +        workers.size should be (2)
    +        workers.foreach { workerSummaryJson =>
    +          val JString(workerId) = workerSummaryJson \ "id"
    +          val url = 
s"http://localhost:${localCluster.masterWebUIPort}/proxy/${workerId}/json";
    +          val workerResponse = parse(Source.fromURL(url)
    +            .getLines().mkString("\n"))
    --- End diff --
    
    nit: seems like this fits in the previous line


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to