Skip to content

Commit de14836

Browse files
author
Marcelo Vanzin
committed
Better fix.
1 parent 6cff13a commit de14836

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/test/scala/org/apache/spark/util/UtilsSuite.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,16 +486,16 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging {
486486

487487
// Test for using the util function to change our log levels.
488488
test("log4j log level change") {
489+
val current = org.apache.log4j.Logger.getRootLogger().getLevel()
489490
try {
490491
Utils.setLogLevel(org.apache.log4j.Level.ALL)
491492
assert(log.isInfoEnabled())
492493
Utils.setLogLevel(org.apache.log4j.Level.ERROR)
493494
assert(!log.isInfoEnabled())
494495
assert(log.isErrorEnabled())
495496
} finally {
496-
// Best effort at undoing changes this test made. Level should be synchronized with the
497-
// log4j.properties file used for testing.
498-
Utils.setLogLevel(org.apache.log4j.Level.INFO)
497+
// Best effort at undoing changes this test made.
498+
Utils.setLogLevel(current)
499499
}
500500
}
501501

0 commit comments

Comments
 (0)