HeartSaVioR commented on code in PR #47819: URL: https://github.com/apache/spark/pull/47819#discussion_r1744980379
########## sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/sources/ForeachWriterSuite.scala: ########## @@ -157,6 +164,23 @@ class ForeachWriterSuite extends StreamTest with SharedSparkSession with BeforeA assert(errorEvent.error.get.getMessage === "ForeachSinkSuite error") // 'close' shouldn't be called with abort message if close with error has been called assert(allEvents(0).size == 3) + + val sparkEx = ExecutorDeadException("network error") + val e2 = intercept[StreamingQueryException] { + val query2 = input.toDS().repartition(1).writeStream + .foreach(new TestForeachWriter() { + override def process(value: Int): Unit = { + super.process(value) + throw sparkEx + } + }).start() + query2.processAllAvailable() + } + + // we didn't wrap the spark exception + assert(!e2.getMessage.contains(errClass)) + assert(e2.getCause.getCause.asInstanceOf[ExecutorDeadException].getMessage Review Comment: Could you please paste the exception hierarchy here? I wonder why this needs one more level to go through. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org