You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2023/07/06 13:31:23 UTC

[GitHub] [spark] MaxGekk commented on a diff in pull request #41878: [SPARK-44268][CORE][TEST][FOLLOWUP] Only print clue when assert doc failed

MaxGekk commented on code in PR #41878:
URL: https://github.com/apache/spark/pull/41878#discussion_r1254446849


##########
core/src/test/scala/org/apache/spark/SparkThrowableSuite.scala:
##########
@@ -155,17 +156,24 @@ class SparkThrowableSuite extends SparkFunSuite {
       .filter(_.startsWith("###")).map(s => s.replace("###", "").trim)
       .filter(linkInDocRegex.findFirstMatchIn(_).isEmpty)
 
-    commonErrorsInDoc.foreach(s => assert(errors.contains(s),
+    def assertWithOnlyClue(condition: Boolean, clue: String): Unit = {
+      if (!condition) {
+       throw new TestFailedException(s"assertion failed: $clue", 0)

Review Comment:
   ```suggestion
           throw new TestFailedException(s"assertion failed: $clue", 0)
   ```



-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org