You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by zs...@apache.org on 2016/03/23 00:42:34 UTC
spark git commit: [HOTFIX][SQL] Add a timeout for 'cq.stop'
Repository: spark
Updated Branches:
refs/heads/master d6dc12ef0 -> d16710b4c
[HOTFIX][SQL] Add a timeout for 'cq.stop'
## What changes were proposed in this pull request?
Fix an issue that DataFrameReaderWriterSuite may hang forever.
## How was this patch tested?
Existing tests.
Author: Shixiong Zhu <sh...@databricks.com>
Closes #11902 from zsxwing/hotfix.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/d16710b4
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/d16710b4
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/d16710b4
Branch: refs/heads/master
Commit: d16710b4c986f0eaf28552ce0e2db33d8c9343b8
Parents: d6dc12e
Author: Shixiong Zhu <sh...@databricks.com>
Authored: Tue Mar 22 16:41:55 2016 -0700
Committer: Shixiong Zhu <sh...@databricks.com>
Committed: Tue Mar 22 16:41:55 2016 -0700
----------------------------------------------------------------------
.../src/test/scala/org/apache/spark/sql/StreamTest.scala | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/d16710b4/sql/core/src/test/scala/org/apache/spark/sql/StreamTest.scala
----------------------------------------------------------------------
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/StreamTest.scala b/sql/core/src/test/scala/org/apache/spark/sql/StreamTest.scala
index f356cde..26c597b 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/StreamTest.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/StreamTest.scala
@@ -28,6 +28,7 @@ import scala.util.control.NonFatal
import org.scalatest.Assertions
import org.scalatest.concurrent.{Eventually, Timeouts}
+import org.scalatest.concurrent.Eventually.timeout
import org.scalatest.concurrent.PatienceConfiguration.Timeout
import org.scalatest.exceptions.TestFailedDueToTimeoutException
import org.scalatest.time.Span
@@ -67,7 +68,14 @@ trait StreamTest extends QueryTest with Timeouts {
implicit class RichContinuousQuery(cq: ContinuousQuery) {
def stopQuietly(): Unit = quietly {
- cq.stop()
+ try {
+ failAfter(10.seconds) {
+ cq.stop()
+ }
+ } catch {
+ case e: TestFailedDueToTimeoutException =>
+ logError(e.getMessage(), e)
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org