Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,11 @@ function renderDagViz(forJob) {
});

metadataContainer().selectAll(".barrier-rdd").each(function() {
var rddId = d3.select(this).text().trim();
var clusterId = VizConstants.clusterPrefix + rddId;
svg.selectAll("g." + clusterId).classed("barrier", true)
var opId = d3.select(this).text().trim();
var opClusterId = VizConstants.clusterPrefix + opId;
var stageId = $(this).parents(".stage-metadata").attr("stage-id");
var stageClusterId = VizConstants.graphPrefix + stageId;
svg.selectAll("g[id=" + stageClusterId + "] g." + opClusterId).classed("barrier", true)
});

resizeSvg(svg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,34 @@ abstract class RealBrowserUISeleniumSuite(val driverProp: String)
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra line

Copy link
Member Author

@sarutak sarutak Jun 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks.

test("SPARK-31886: Color barrier execution mode RDD correctly") {
withSpark(newSparkContext()) { sc =>
sc.parallelize(1 to 10).barrier.mapPartitions(identity).repartition(1).collect()

eventually(timeout(10.seconds), interval(50.milliseconds)) {
goToUi(sc, "/jobs/job/?id=0")
webDriver.findElement(By.id("job-dag-viz")).click()

val stage0 = webDriver.findElement(By.cssSelector("g[id='graph_0']"))
val stage1 = webDriver.findElement(By.cssSelector("g[id='graph_1']"))
val barrieredOps = webDriver.findElements(By.className("barrier-rdd")).iterator()

while (barrieredOps.hasNext) {
val barrieredOpId = barrieredOps.next().getAttribute("innerHTML")
val foundInStage0 =
stage0.findElements(
By.cssSelector("g.barrier.cluster.cluster_" + barrieredOpId))
assert(foundInStage0.size === 1)

val foundInStage1 =
stage1.findElements(
By.cssSelector("g.barrier.cluster.cluster_" + barrieredOpId))
assert(foundInStage1.size === 0)
}
}
}
}

/**
* Create a test SparkContext with the SparkUI enabled.
* It is safe to `get` the SparkUI directly from the SparkContext returned here.
Expand Down