Github user zsxwing commented on a diff in the pull request:
https://github.com/apache/spark/pull/11030#discussion_r52072076
--- Diff: sql/core/src/test/scala/org/apache/spark/sql/StreamTest.scala ---
@@ -343,4 +431,58 @@ trait StreamTest extends QueryTest with Timeouts {
addCheck()
testStream(ds)(actions: _*)
}
+
+
+ object AwaitTerminationTester {
+
+ trait ExpectedBehavior
+
+ /** Expect awaitTermination to not be blocked */
+ case object ExpectNotBlocked extends ExpectedBehavior
+
+ /** Expect awaitTermination to get blocked */
+ case object ExpectBlocked extends ExpectedBehavior
+
+ /** Expect awaitTermination to throw an exception */
+ case class ExpectException[E <: Exception]()(implicit val t:
ClassTag[E])
+ extends ExpectedBehavior
+
+ private val DEFAULT_TEST_TIMEOUT = 1 second
+
+ def test(
+ expectedBehavior: ExpectedBehavior,
+ awaitTermFunc: () => Unit,
+ testTimeout: Span = DEFAULT_TEST_TIMEOUT
+ ): Unit = {
+
+ expectedBehavior match {
--- End diff --
nit: indent
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]