This is an automated email from the ASF dual-hosted git repository. maxgekk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new 97ba9d29cd1 [SPARK-38723][SS][TEST][FOLLOWUP] Deflake the newly added test in QueryExecutionErrorsSuite 97ba9d29cd1 is described below commit 97ba9d29cd1ff83755b0d02251d249a625caace5 Author: Wei Liu <wei....@databricks.com> AuthorDate: Tue Oct 31 09:38:50 2023 +0300 [SPARK-38723][SS][TEST][FOLLOWUP] Deflake the newly added test in QueryExecutionErrorsSuite ### What changes were proposed in this pull request? The newly added test in https://github.com/apache/spark/commit/7d7afb06f682c10f3900eb8adeab9fad6d49cb24 could be flaky, this change deflakes it. Details see comments. ### Why are the changes needed? Deflaky ### Does this PR introduce _any_ user-facing change? Test only change ### How was this patch tested? Test only change ### Was this patch authored or co-authored using generative AI tooling? No Closes #43565 from WweiL/SPARK-38723-followup. Authored-by: Wei Liu <wei....@databricks.com> Signed-off-by: Max Gekk <max.g...@gmail.com> --- .../spark/sql/errors/QueryExecutionErrorsSuite.scala | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala index 945dd782da0..dd3f3dc6004 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala @@ -22,6 +22,8 @@ import java.net.{URI, URL} import java.sql.{Connection, DatabaseMetaData, Driver, DriverManager, PreparedStatement, ResultSet, ResultSetMetaData} import java.util.{Locale, Properties, ServiceConfigurationError} +import scala.jdk.CollectionConverters._ + import org.apache.hadoop.fs.{LocalFileSystem, Path} import org.apache.hadoop.fs.permission.FsPermission import org.mockito.Mockito.{mock, spy, when} @@ -910,15 +912,15 @@ class QueryExecutionErrorsSuite } exception } - assert(exceptions.map(e => e.isDefined).reduceLeft(_ || _)) - exceptions.map { e => - if (e.isDefined) { - checkError( - e.get, - errorClass = "CONCURRENT_QUERY", - sqlState = Some("0A000") - ) - } + // Only check if errors exist to deflake. We couldn't guarantee that + // the above 50 runs must hit this error. + exceptions.flatten.map { e => + checkError( + e, + errorClass = "CONCURRENT_QUERY", + sqlState = Some("0A000"), + parameters = e.getMessageParameters.asScala.toMap + ) } spark.streams.active.foreach(_.stop()) } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org