Skip to content

Commit 12c1c36

Browse files
Andrew Orrxin
authored andcommitted
[SPARK-8910] Fix MiMa flaky due to port contention issue
Due to the way MiMa works, we currently start a `SQLContext` pretty early on. This causes us to start a `SparkUI` that attempts to bind to port 4040. Because many tests run in parallel on the Jenkins machines, this causes port contention sometimes and fails the MiMa tests. Note that we already disabled the SparkUI for scalatests. However, the MiMa test is run before we even have a chance to load the default scalatest settings, so we need to explicitly disable the UI ourselves. Author: Andrew Or <[email protected]> Closes #7300 from andrewor14/mima-flaky and squashes the following commits: b55a547 [Andrew Or] Do not enable SparkUI during tests (cherry picked from commit 47ef423) Signed-off-by: Reynold Xin <[email protected]>
1 parent 2fb2ef0 commit 12c1c36

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

sql/core/src/main/scala/org/apache/spark/sql/test/TestSQLContext.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
2626
/** A SQLContext that can be used for local testing. */
2727
class LocalSQLContext
2828
extends SQLContext(
29-
new SparkContext(
30-
"local[2]",
31-
"TestSQLContext",
32-
new SparkConf().set("spark.sql.testkey", "true"))) {
29+
new SparkContext("local[2]", "TestSQLContext", new SparkConf()
30+
.set("spark.sql.testkey", "true")
31+
// SPARK-8910
32+
.set("spark.ui.enabled", "false"))) {
3333

3434
override protected[sql] def createSession(): SQLSession = {
3535
new this.SQLSession()

sql/hive/src/main/scala/org/apache/spark/sql/hive/test/TestHive.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ object TestHive
5353
"TestSQLContext",
5454
new SparkConf()
5555
.set("spark.sql.test", "")
56-
.set(
57-
"spark.sql.hive.metastore.barrierPrefixes",
58-
"org.apache.spark.sql.hive.execution.PairSerDe")))
56+
.set("spark.sql.hive.metastore.barrierPrefixes",
57+
"org.apache.spark.sql.hive.execution.PairSerDe")
58+
// SPARK-8910
59+
.set("spark.ui.enabled", "false")))
5960

6061
/**
6162
* A locally running test instance of Spark's Hive execution engine.

0 commit comments

Comments
 (0)