Skip to content
Snippets Groups Projects
Commit ecc9bfe3 authored by Shivaram Venkataraman's avatar Shivaram Venkataraman
Browse files

Create SparkContext in beforeAll for MLLib tests

This overcomes test failures that occur using Maven
parent 37964863
No related branches found
No related tags found
No related merge requests found
...@@ -67,7 +67,12 @@ object LogisticRegressionSuite { ...@@ -67,7 +67,12 @@ object LogisticRegressionSuite {
} }
class LogisticRegressionSuite extends FunSuite with BeforeAndAfterAll with ShouldMatchers { class LogisticRegressionSuite extends FunSuite with BeforeAndAfterAll with ShouldMatchers {
val sc = new SparkContext("local", "test") @transient private var sc: SparkContext = _
override def beforeAll() {
sc = new SparkContext("local", "test")
}
override def afterAll() { override def afterAll() {
sc.stop() sc.stop()
......
...@@ -62,7 +62,11 @@ object SVMSuite { ...@@ -62,7 +62,11 @@ object SVMSuite {
} }
class SVMSuite extends FunSuite with BeforeAndAfterAll { class SVMSuite extends FunSuite with BeforeAndAfterAll {
val sc = new SparkContext("local", "test") @transient private var sc: SparkContext = _
override def beforeAll() {
sc = new SparkContext("local", "test")
}
override def afterAll() { override def afterAll() {
sc.stop() sc.stop()
......
...@@ -27,9 +27,12 @@ import spark.SparkContext._ ...@@ -27,9 +27,12 @@ import spark.SparkContext._
import org.jblas._ import org.jblas._
class KMeansSuite extends FunSuite with BeforeAndAfterAll { class KMeansSuite extends FunSuite with BeforeAndAfterAll {
val sc = new SparkContext("local", "test") @transient private var sc: SparkContext = _
override def beforeAll() {
sc = new SparkContext("local", "test")
}
override def afterAll() { override def afterAll() {
sc.stop() sc.stop()
......
...@@ -66,7 +66,11 @@ object ALSSuite { ...@@ -66,7 +66,11 @@ object ALSSuite {
class ALSSuite extends FunSuite with BeforeAndAfterAll { class ALSSuite extends FunSuite with BeforeAndAfterAll {
val sc = new SparkContext("local", "test") @transient private var sc: SparkContext = _
override def beforeAll() {
sc = new SparkContext("local", "test")
}
override def afterAll() { override def afterAll() {
sc.stop() sc.stop()
......
...@@ -57,7 +57,12 @@ object LassoSuite { ...@@ -57,7 +57,12 @@ object LassoSuite {
} }
class LassoSuite extends FunSuite with BeforeAndAfterAll { class LassoSuite extends FunSuite with BeforeAndAfterAll {
val sc = new SparkContext("local", "test") @transient private var sc: SparkContext = _
override def beforeAll() {
sc = new SparkContext("local", "test")
}
override def afterAll() { override def afterAll() {
sc.stop() sc.stop()
......
...@@ -27,7 +27,11 @@ import spark.SparkContext._ ...@@ -27,7 +27,11 @@ import spark.SparkContext._
class RidgeRegressionSuite extends FunSuite with BeforeAndAfterAll { class RidgeRegressionSuite extends FunSuite with BeforeAndAfterAll {
val sc = new SparkContext("local", "test") @transient private var sc: SparkContext = _
override def beforeAll() {
sc = new SparkContext("local", "test")
}
override def afterAll() { override def afterAll() {
sc.stop() sc.stop()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment