Skip to content
Snippets Groups Projects
Commit 72bac09c authored by Dmitriy Lyubimov's avatar Dmitriy Lyubimov
Browse files

Leaking spark context in the test

parent ef82ff85
No related branches found
No related tags found
No related merge requests found
......@@ -133,9 +133,13 @@ class KryoSerializerSuite extends FunSuite {
System.setProperty("spark.kryo.registrator", classOf[MyRegistrator].getName)
val sc = new SparkContext("local", "kryoTest")
val control = 1 :: 2 :: Nil
val result = sc.parallelize(control, 2).map(new ClassWithoutNoArgConstructor(_)).collect().map(_.x)
assert(control == result.toSeq)
try {
val control = 1 :: 2 :: Nil
val result = sc.parallelize(control, 2).map(new ClassWithoutNoArgConstructor(_)).collect().map(_.x)
assert(control == result.toSeq)
} finally {
sc.stop()
}
System.clearProperty("spark.kryo.registrator")
System.clearProperty("spark.serializer")
......
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