aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJosh Rosen <joshrosen@databricks.com>2015-11-11 14:30:38 -0800
committerReynold Xin <rxin@databricks.com>2015-11-11 14:30:38 -0800
commit2d76e44b1a88e08047806972b2d241a89e499bab (patch)
tree265e8e1e976d30a0c05fbadea7642f0e3048f012 /core
parentdd77e278b99e45c20fdefb1c795f3c5148d577db (diff)
downloadspark-2d76e44b1a88e08047806972b2d241a89e499bab.tar.gz
spark-2d76e44b1a88e08047806972b2d241a89e499bab.tar.bz2
spark-2d76e44b1a88e08047806972b2d241a89e499bab.zip
[SPARK-11647] Attempt to reduce time/flakiness of Thriftserver CLI and SparkSubmit tests
This patch aims to reduce the test time and flakiness of HiveSparkSubmitSuite, SparkSubmitSuite, and CliSuite. Key changes: - Disable IO synchronization calls for Derby writes, since durability doesn't matter for tests. This was done for HiveCompatibilitySuite in #6651 and resulted in huge test speedups. - Add a few missing `--conf`s to disable various Spark UIs. The CliSuite, in particular, never disabled these UIs, leaving it prone to port-contention-related flakiness. - Fix two instances where tests defined `beforeAll()` methods which were never called because the appropriate traits were not mixed in. I updated these tests suites to extend `BeforeAndAfterEach` so that they play nicely with our `ResetSystemProperties` trait. Author: Josh Rosen <joshrosen@databricks.com> Closes #9623 from JoshRosen/SPARK-11647.
Diffstat (limited to 'core')
-rw-r--r--core/src/test/scala/org/apache/spark/deploy/RPackageUtilsSuite.scala12
-rw-r--r--core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala6
2 files changed, 11 insertions, 7 deletions
diff --git a/core/src/test/scala/org/apache/spark/deploy/RPackageUtilsSuite.scala b/core/src/test/scala/org/apache/spark/deploy/RPackageUtilsSuite.scala
index 1ed4bae3ca..cc30ba223e 100644
--- a/core/src/test/scala/org/apache/spark/deploy/RPackageUtilsSuite.scala
+++ b/core/src/test/scala/org/apache/spark/deploy/RPackageUtilsSuite.scala
@@ -33,8 +33,12 @@ import org.scalatest.BeforeAndAfterEach
import org.apache.spark.SparkFunSuite
import org.apache.spark.api.r.RUtils
import org.apache.spark.deploy.SparkSubmitUtils.MavenCoordinate
+import org.apache.spark.util.ResetSystemProperties
-class RPackageUtilsSuite extends SparkFunSuite with BeforeAndAfterEach {
+class RPackageUtilsSuite
+ extends SparkFunSuite
+ with BeforeAndAfterEach
+ with ResetSystemProperties {
private val main = MavenCoordinate("a", "b", "c")
private val dep1 = MavenCoordinate("a", "dep1", "c")
@@ -60,11 +64,9 @@ class RPackageUtilsSuite extends SparkFunSuite with BeforeAndAfterEach {
}
}
- def beforeAll() {
- System.setProperty("spark.testing", "true")
- }
-
override def beforeEach(): Unit = {
+ super.beforeEach()
+ System.setProperty("spark.testing", "true")
lineBuffer.clear()
}
diff --git a/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala b/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala
index 1fd470cd3b..66a5051200 100644
--- a/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala
+++ b/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala
@@ -23,7 +23,7 @@ import scala.collection.mutable.ArrayBuffer
import com.google.common.base.Charsets.UTF_8
import com.google.common.io.ByteStreams
-import org.scalatest.Matchers
+import org.scalatest.{BeforeAndAfterEach, Matchers}
import org.scalatest.concurrent.Timeouts
import org.scalatest.time.SpanSugar._
@@ -37,10 +37,12 @@ import org.apache.spark.util.{ResetSystemProperties, Utils}
class SparkSubmitSuite
extends SparkFunSuite
with Matchers
+ with BeforeAndAfterEach
with ResetSystemProperties
with Timeouts {
- def beforeAll() {
+ override def beforeEach() {
+ super.beforeEach()
System.setProperty("spark.testing", "true")
}