You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sr...@apache.org on 2015/07/01 21:40:54 UTC

spark git commit: [SPARK-3444] [CORE] Restore INFO level after log4j test.

Repository: spark
Updated Branches:
  refs/heads/master 3083e1764 -> 1ce642890


[SPARK-3444] [CORE] Restore INFO level after log4j test.

Otherwise other tests don't log anything useful...

Author: Marcelo Vanzin <va...@cloudera.com>

Closes #7140 from vanzin/SPARK-3444 and squashes the following commits:

de14836 [Marcelo Vanzin] Better fix.
6cff13a [Marcelo Vanzin] [SPARK-3444] [core] Restore INFO level after log4j test.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/1ce64289
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/1ce64289
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/1ce64289

Branch: refs/heads/master
Commit: 1ce6428907b4ddcf52dbf0c86196d82ab7392442
Parents: 3083e17
Author: Marcelo Vanzin <va...@cloudera.com>
Authored: Wed Jul 1 20:40:47 2015 +0100
Committer: Sean Owen <so...@cloudera.com>
Committed: Wed Jul 1 20:40:47 2015 +0100

----------------------------------------------------------------------
 .../scala/org/apache/spark/util/UtilsSuite.scala    | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/1ce64289/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
index baa4c66..251a797 100644
--- a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
+++ b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
@@ -486,11 +486,17 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging {
 
   // Test for using the util function to change our log levels.
   test("log4j log level change") {
-    Utils.setLogLevel(org.apache.log4j.Level.ALL)
-    assert(log.isInfoEnabled())
-    Utils.setLogLevel(org.apache.log4j.Level.ERROR)
-    assert(!log.isInfoEnabled())
-    assert(log.isErrorEnabled())
+    val current = org.apache.log4j.Logger.getRootLogger().getLevel()
+    try {
+      Utils.setLogLevel(org.apache.log4j.Level.ALL)
+      assert(log.isInfoEnabled())
+      Utils.setLogLevel(org.apache.log4j.Level.ERROR)
+      assert(!log.isInfoEnabled())
+      assert(log.isErrorEnabled())
+    } finally {
+      // Best effort at undoing changes this test made.
+      Utils.setLogLevel(current)
+    }
   }
 
   test("deleteRecursively") {


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