Skip to content

Commit 6a2289e

Browse files
squitocloud-fan
authored andcommitted
[SPARK-23962][SQL][TEST] Fix race in currentExecutionIds().
SQLMetricsTestUtils.currentExecutionIds() was racing with the listener bus, which lead to some flaky tests. We should wait till the listener bus is empty. I tested by adding some Thread.sleep()s in SQLAppStatusListener, which reproduced the exceptions I saw on Jenkins. With this change, they went away. Author: Imran Rashid <[email protected]> Closes apache#21041 from squito/SPARK-23962.
1 parent e904dfa commit 6a2289e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsTestUtils.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ trait SQLMetricsTestUtils extends SQLTestUtils {
3434
import testImplicits._
3535

3636
protected def currentExecutionIds(): Set[Long] = {
37+
spark.sparkContext.listenerBus.waitUntilEmpty(10000)
3738
statusStore.executionsList.map(_.executionId).toSet
3839
}
3940

0 commit comments

Comments
 (0)