Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
0.9.1
-
None
Description
Much of SparkListenerSuite relies on LiveListenerBus's waitUntilEmpty() method. As the name suggests, this waits until the event queue is empty. However, the following race condition could happen:
(1) We dequeue the event
(2) The queue is empty, we return true
(3) The test asserts something assuming that all listeners have finished executing (and fails)
(4) The listeners receive the event
This has been a possible race condition for a long time, but for some reason we've never run into it.