Skip to content

Commit 710d81e

Browse files
Marcelo Vanzinmaropu
authored andcommitted
[SPARK-26732][CORE][TEST] Wait for listener bus to process events in SparkContextInfoSuite.
Otherwise the RDD data may be out of date by the time the test tries to check it. Tested with an artificial delay inserted in AppStatusListener. Closes #23654 from vanzin/SPARK-26732. Authored-by: Marcelo Vanzin <vanzin@cloudera.com> Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org> (cherry picked from commit 6a2f3dc) Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org>
1 parent ae0592d commit 710d81e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class SparkContextInfoSuite extends SparkFunSuite with LocalSparkContext {
6060
val rdd = sc.makeRDD(Array(1, 2, 3, 4), 2).cache()
6161
assert(sc.getRDDStorageInfo.size === 0)
6262
rdd.collect()
63+
sc.listenerBus.waitUntilEmpty(10000)
6364
assert(sc.getRDDStorageInfo.size === 1)
6465
assert(sc.getRDDStorageInfo.head.isCached)
6566
assert(sc.getRDDStorageInfo.head.memSize > 0)

0 commit comments

Comments
 (0)