From de1483629bc6f88cf2ff64b0eb1f4c51ffbb6e65 Mon Sep 17 00:00:00 2001 From: Marcelo Vanzin Date: Tue, 30 Jun 2015 21:18:51 -0700 Subject: [PATCH] Better fix. --- core/src/test/scala/org/apache/spark/util/UtilsSuite.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 4462baf19f548..251a797dc28a2 100644 --- a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala @@ -486,6 +486,7 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging { // Test for using the util function to change our log levels. test("log4j log level change") { + val current = org.apache.log4j.Logger.getRootLogger().getLevel() try { Utils.setLogLevel(org.apache.log4j.Level.ALL) assert(log.isInfoEnabled()) @@ -493,9 +494,8 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging { assert(!log.isInfoEnabled()) assert(log.isErrorEnabled()) } finally { - // Best effort at undoing changes this test made. Level should be synchronized with the - // log4j.properties file used for testing. - Utils.setLogLevel(org.apache.log4j.Level.INFO) + // Best effort at undoing changes this test made. + Utils.setLogLevel(current) } }