Skip to content

Commit e5ed096

Browse files
committed
Ignore exception from awaitInitialization to avoid breaking tests
1 parent 3bc2eff commit e5ed096

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,12 @@ trait StreamTest extends QueryTest with SharedSQLContext with Timeouts {
385385
.streamingQuery
386386
// Wait until the initialization finishes, because some tests need to use `logicalPlan`
387387
// after starting the query.
388-
currentStream.awaitInitialization(streamingTimeout.toMillis)
388+
try {
389+
currentStream.awaitInitialization(streamingTimeout.toMillis)
390+
} catch {
391+
case _: StreamingQueryException =>
392+
// Ignore the exception. `StopStream` or `ExpectFailure` will catch it as well.
393+
}
389394

390395
case AdvanceManualClock(timeToAdd) =>
391396
verify(currentStream != null,

0 commit comments

Comments
 (0)