Github user jkbradley commented on a diff in the pull request: https://github.com/apache/spark/pull/20852#discussion_r175524288 --- Diff: mllib/src/test/scala/org/apache/spark/ml/util/MLTest.scala --- @@ -119,9 +119,15 @@ trait MLTest extends StreamTest with TempDirectory { self: Suite => expectedMessagePart : String, firstResultCol: String) { + def hasExpectedMessageDirectly(exception: Throwable): Boolean = + exception.getMessage.contains(expectedMessagePart) + def hasExpectedMessage(exception: Throwable): Boolean = - exception.getMessage.contains(expectedMessagePart) || - (exception.getCause != null && exception.getCause.getMessage.contains(expectedMessagePart)) + hasExpectedMessageDirectly(exception) || ( + exception.getCause != null && ( + hasExpectedMessageDirectly(exception.getCause) || ( + exception.getCause.getCause != null && + hasExpectedMessageDirectly(exception.getCause.getCause)))) --- End diff -- I don't think we need to loop further. If the real message is buried this deep, that could be considered a problem in and of itself.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org