File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
main/scala/org/apache/spark/ui/jobs
test/scala/org/apache/spark/ui Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
4343 }
4444
4545 def makeRow (job : JobUIData ): Seq [Node ] = {
46- val lastStageInfo = job.stageIds.lastOption.flatMap( listener.stageIdToInfo.get)
46+ val lastStageInfo = listener.stageIdToInfo.get(job.stageIds.max )
4747 val lastStageData = lastStageInfo.flatMap { s =>
4848 listener.stageIdToData.get((s.stageId, s.attemptId))
4949 }
Original file line number Diff line number Diff line change @@ -238,4 +238,24 @@ class UISeleniumSuite extends FunSuite with WebBrowser with Matchers {
238238 }
239239 }
240240 }
241+
242+
243+ test(" jobs with stages thatare skipped should show correct link descriptions on jobs page" ) {
244+ withSpark(newSparkContext()) { sc =>
245+ // Create an RDD that involves multiple stages:
246+ val rdd =
247+ sc.parallelize(Seq (1 , 2 , 3 )).map(identity).groupBy(identity).map(identity).groupBy(identity)
248+ // Run it twice; this will cause the second job to have two "phantom" stages that were
249+ // mentioned in its job start event but which were never actually executed:
250+ rdd.count()
251+ rdd.count()
252+ eventually(timeout(10 seconds), interval(50 milliseconds)) {
253+ go to (sc.ui.get.appUIAddress.stripSuffix(" /" ) + " /jobs" )
254+ findAll(cssSelector(" tbody tr a" )).foreach { link =>
255+ link.text.toLowerCase should include (" count" )
256+ link.text.toLowerCase should not include " unknown"
257+ }
258+ }
259+ }
260+ }
241261}
You can’t perform that action at this time.
0 commit comments