Skip to content

Commit

Permalink
[SPARK-26079][SQL] Ensure listener event delivery in StreamingQueryLi…
Browse files Browse the repository at this point in the history
…stenersConfSuite.

Events are dispatched on a separate thread, so need to wait for them to be
actually delivered before checking that the listener got them.

Closes apache#23050 from vanzin/SPARK-26079.

Authored-by: Marcelo Vanzin <vanzin@cloudera.com>
Signed-off-by: hyukjinkwon <gurwls223@apache.org>
  • Loading branch information
Marcelo Vanzin authored and HyukjinKwon committed Nov 17, 2018
1 parent d279204 commit 23cd0e6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class StreamingQueryListenersConfSuite extends StreamTest with BeforeAndAfter {

import testImplicits._


override protected def sparkConf: SparkConf =
super.sparkConf.set("spark.sql.streaming.streamingQueryListeners",
"org.apache.spark.sql.streaming.TestListener")
Expand All @@ -41,6 +40,8 @@ class StreamingQueryListenersConfSuite extends StreamTest with BeforeAndAfter {
StopStream
)

spark.sparkContext.listenerBus.waitUntilEmpty(5000)

assert(TestListener.queryStartedEvent != null)
assert(TestListener.queryTerminatedEvent != null)
}
Expand Down

0 comments on commit 23cd0e6

Please sign in to comment.