Skip to content

Commit 111007d

Browse files
committed
Fix broadcast tests.
1 parent 797c247 commit 111007d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ package org.apache.spark
1919

2020
import java.lang.ref.WeakReference
2121

22+
import org.apache.spark.broadcast.Broadcast
23+
24+
import scala.collection.mutable
2225
import scala.collection.mutable.{HashSet, SynchronizedSet}
2326
import scala.language.existentials
2427
import scala.language.postfixOps
@@ -159,7 +162,7 @@ class ContextCleanerSuite extends FunSuite with BeforeAndAfter with LocalSparkCo
159162
val broadcastBuffer = (1 to numBroadcasts).map(i => randomBroadcast()).toBuffer
160163
val rddIds = sc.persistentRdds.keys.toSeq
161164
val shuffleIds = 0 until sc.newShuffleId
162-
val broadcastIds = 0L until numBroadcasts
165+
val broadcastIds = broadcastBuffer.map(_.id)
163166

164167
val preGCTester = new CleanerTester(sc, rddIds, shuffleIds, broadcastIds)
165168
runGC()
@@ -190,7 +193,7 @@ class ContextCleanerSuite extends FunSuite with BeforeAndAfter with LocalSparkCo
190193
val broadcastBuffer = (1 to numBroadcasts).map(i => randomBroadcast()).toBuffer
191194
val rddIds = sc.persistentRdds.keys.toSeq
192195
val shuffleIds = 0 until sc.newShuffleId
193-
val broadcastIds = 0L until numBroadcasts
196+
val broadcastIds = broadcastBuffer.map(_.id)
194197

195198
val preGCTester = new CleanerTester(sc, rddIds, shuffleIds, broadcastIds)
196199
runGC()

0 commit comments

Comments
 (0)