spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zsxw...@apache.org
Subject spark git commit: [SPARK-19113][SS][TESTS] Ignore StreamingQueryException thrown from awaitInitialization to avoid breaking tests
Date Wed, 18 Jan 2017 18:50:53 GMT
Repository: spark
Updated Branches:
  refs/heads/master 33791a8ce -> c050c1227


[SPARK-19113][SS][TESTS] Ignore StreamingQueryException thrown from awaitInitialization to
avoid breaking tests

## What changes were proposed in this pull request?

#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 <shixiong@databricks.com>

Closes #16567 from zsxwing/SPARK-19113-2.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/c050c122
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/c050c122
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/c050c122

Branch: refs/heads/master
Commit: c050c12274fba2ac4c4938c4724049a47fa59280
Parents: 33791a8
Author: Shixiong Zhu <shixiong@databricks.com>
Authored: Wed Jan 18 10:50:51 2017 -0800
Committer: Shixiong Zhu <shixiong@databricks.com>
Committed: Wed Jan 18 10:50:51 2017 -0800

----------------------------------------------------------------------
 .../scala/org/apache/spark/sql/streaming/StreamTest.scala     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/c050c122/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala
----------------------------------------------------------------------
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 4aa4100..af2f31a 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,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message