Skip to content

Commit

Permalink
[SPARK-19113][SS][TESTS] Ignore StreamingQueryException thrown from a…
Browse files Browse the repository at this point in the history
…waitInitialization to avoid breaking tests

## What changes were proposed in this pull request?

apache#16492 missed one race condition: `StreamExecution.awaitInitialization` may throw fatal errors and fail the test. This PR just ignores `StreamingQueryException` thrown from `awaitInitialization` so that we can verify the exception in the `ExpectFailure` action later. It's fine since `StopStream` or `ExpectFailure` will catch `StreamingQueryException` as well.

## How was this patch tested?

Jenkins

Author: Shixiong Zhu <[email protected]>

Closes apache#16567 from zsxwing/SPARK-19113-2.
  • Loading branch information
zsxwing authored and cmonkey committed Feb 15, 2017
1 parent 330f726 commit 58ea392
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 58ea392

Please sign in to comment.