Skip to content

Commit 7a15839

Browse files
kayousterhoutJoshRosen
authored andcommitted
[SPARK-6753] Clone SparkConf in ShuffleSuite tests
Prior to this change, the unit test for SPARK-3426 did not clone the original SparkConf, which meant that that test did not use the options set by suites that subclass ShuffleSuite.scala. This commit fixes that problem. JoshRosen would be great if you could take a look at this, since you wrote this test originally. Author: Kay Ousterhout <kayousterhout@gmail.com> Closes #5401 from kayousterhout/SPARK-6753 and squashes the following commits: 368c540 [Kay Ousterhout] [SPARK-6753] Clone SparkConf in ShuffleSuite tests (cherry picked from commit 9d44ddc) Signed-off-by: Josh Rosen <joshrosen@databricks.com>
1 parent f7fe87f commit 7a15839

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/test/scala/org/apache/spark/ShuffleSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,14 @@ abstract class ShuffleSuite extends FunSuite with Matchers with LocalSparkContex
243243
shuffleSpillCompress <- Set(true, false);
244244
shuffleCompress <- Set(true, false)
245245
) {
246-
val conf = new SparkConf()
246+
val myConf = conf.clone()
247247
.setAppName("test")
248248
.setMaster("local")
249249
.set("spark.shuffle.spill.compress", shuffleSpillCompress.toString)
250250
.set("spark.shuffle.compress", shuffleCompress.toString)
251251
.set("spark.shuffle.memoryFraction", "0.001")
252252
resetSparkContext()
253-
sc = new SparkContext(conf)
253+
sc = new SparkContext(myConf)
254254
try {
255255
sc.parallelize(0 until 100000).map(i => (i / 4, i)).groupByKey().collect()
256256
} catch {

0 commit comments

Comments
 (0)