Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11030#discussion_r51666865
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/StreamTest.scala ---
    @@ -211,37 +264,69 @@ trait StreamTest extends QueryTest with Timeouts {
                   })
     
               case StopStream =>
    -            checkState(currentStream != null, "can not stop a stream that 
is not running")
    -            currentStream.stop()
    -            currentStream = null
    +            assert(currentStream != null, "can not stop a stream that is 
not running")
    +            try failAfter(streamingTimout) {
    +              currentStream.stop()
    +              assert(!currentStream.microBatchThread.isAlive,
    +                s"microbatch thread not stopped")
    +              assert(!currentStream.isActive,
    +                "query.isActive() is false even after stopping")
    +              assert(currentStream.exception.isEmpty,
    +                "query.exception() is not empty after clean stop")
    +            } catch {
    +              case _: InterruptedException =>
    +              case _: 
org.scalatest.exceptions.TestFailedDueToTimeoutException =>
    +                failTest("Timed out while stopping and waiting for 
microbatchthread to terminate.")
    +              case t: Throwable =>
    +                failTest("Error while checking stream failure.", t)
    +            } finally {
    +              lastStream = currentStream
    +              currentStream = null
    +            }
    --- End diff --
    
    This doesn't need to be in a finally block right?


---
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]

Reply via email to