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

    https://github.com/apache/spark/pull/12048#discussion_r58268028
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/StreamTest.scala ---
    @@ -224,11 +239,8 @@ trait StreamTest extends QueryTest with Timeouts {
              """.stripMargin
     
         def verify(condition: => Boolean, message: String): Unit = {
    -      try {
    -        Assertions.assert(condition)
    -      } catch {
    -        case NonFatal(e) =>
    -          failTest(message, e)
    +      if (!condition) {
    --- End diff --
    
    All uses of `verify` are just doing equality checks with variables (and 
thus can't throw), except for those that were modified specifically such that 
that were going to throw exceptions upon failure.  So I think really the 
problem is overloading what was a simple assert to be an error handler.
    
    The issue this this construction is it now pollutes the output with the 
obvious:
    ```
    condition was false
    [info]   
org.scalatest.Assertions$class.newAssertionFailedException(Assertions.scala:500)
    [info]          
org.scalatest.FunSuite.newAssertionFailedException(FunSuite.scala:1555)
    [info]          
org.scalatest.Assertions$AssertionsHelper.macroAssert(Assertions.scala:466)
    [info]          
org.apache.spark.sql.StreamTest$class.verify$1(StreamTest.scala:228)
    [info]          
org.apache.spark.sql.StreamTest$$anonfun$testStream$1.apply(StreamTest.scala:355)
    [info]          
org.apache.spark.sql.StreamTest$$anonfun$testStream$1.apply(StreamTest.scala:271)
    [info]          
scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
    [info]          
scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
    [info]          
org.apache.spark.sql.StreamTest$class.testStream(StreamTest.scala:271)
    [info]          
org.apache.spark.sql.streaming.StreamSuite.testStream(StreamSuite.scala:24)
    ```


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