From e5ed096bbf719bcd34d36e31485f939b633f43f4 Mon Sep 17 00:00:00 2001 From: Shixiong Zhu Date: Thu, 12 Jan 2017 22:22:41 -0800 Subject: [PATCH] Ignore exception from awaitInitialization to avoid breaking tests --- .../scala/org/apache/spark/sql/streaming/StreamTest.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala index 4aa4100522cd..af2f31a34d8d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala @@ -385,7 +385,12 @@ trait StreamTest extends QueryTest with SharedSQLContext with Timeouts { .streamingQuery // Wait until the initialization finishes, because some tests need to use `logicalPlan` // after starting the query. - currentStream.awaitInitialization(streamingTimeout.toMillis) + try { + currentStream.awaitInitialization(streamingTimeout.toMillis) + } catch { + case _: StreamingQueryException => + // Ignore the exception. `StopStream` or `ExpectFailure` will catch it as well. + } case AdvanceManualClock(timeToAdd) => verify(currentStream != null,