aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShixiong Zhu <shixiong@databricks.com>2017-03-03 19:00:35 -0800
committerXiao Li <gatorsmile@gmail.com>2017-03-03 19:00:35 -0800
commitfbc4058037cf5b0be9f14a7dd28105f7f8151bed (patch)
tree01357e23497393307c9433888322dceff950f8dc
parent9e5b4ce727cf262a14a411efded85ee1e50a88ed (diff)
downloadspark-fbc4058037cf5b0be9f14a7dd28105f7f8151bed.tar.gz
spark-fbc4058037cf5b0be9f14a7dd28105f7f8151bed.tar.bz2
spark-fbc4058037cf5b0be9f14a7dd28105f7f8151bed.zip
[SPARK-19816][SQL][TESTS] Fix an issue that DataFrameCallbackSuite doesn't recover the log level
## What changes were proposed in this pull request? "DataFrameCallbackSuite.execute callback functions when a DataFrame action failed" sets the log level to "fatal" but doesn't recover it. Hence, tests running after it won't output any logs except fatal logs. This PR uses `testQuietly` instead to avoid changing the log level. ## How was this patch tested? Jenkins Author: Shixiong Zhu <shixiong@databricks.com> Closes #17156 from zsxwing/SPARK-19816.
-rw-r--r--sql/core/src/test/scala/org/apache/spark/sql/util/DataFrameCallbackSuite.scala4
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/util/DataFrameCallbackSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/util/DataFrameCallbackSuite.scala
index 9f27d06dcb..7c9ea7d393 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/util/DataFrameCallbackSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/util/DataFrameCallbackSuite.scala
@@ -60,7 +60,7 @@ class DataFrameCallbackSuite extends QueryTest with SharedSQLContext {
spark.listenerManager.unregister(listener)
}
- test("execute callback functions when a DataFrame action failed") {
+ testQuietly("execute callback functions when a DataFrame action failed") {
val metrics = ArrayBuffer.empty[(String, QueryExecution, Exception)]
val listener = new QueryExecutionListener {
override def onFailure(funcName: String, qe: QueryExecution, exception: Exception): Unit = {
@@ -75,8 +75,6 @@ class DataFrameCallbackSuite extends QueryTest with SharedSQLContext {
val errorUdf = udf[Int, Int] { _ => throw new RuntimeException("udf error") }
val df = sparkContext.makeRDD(Seq(1 -> "a")).toDF("i", "j")
- // Ignore the log when we are expecting an exception.
- sparkContext.setLogLevel("FATAL")
val e = intercept[SparkException](df.select(errorUdf($"i")).collect())
assert(metrics.length == 1)