Skip to content

Commit

Permalink
[SPARK-3444] [core] Restore INFO level after log4j test.
Browse files Browse the repository at this point in the history
Otherwise other tests don't log anything useful...
  • Loading branch information
Marcelo Vanzin committed Jul 1, 2015
1 parent a48e619 commit 6cff13a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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())
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. Level should be synchronized with the
// log4j.properties file used for testing.
Utils.setLogLevel(org.apache.log4j.Level.INFO)
}
}

test("deleteRecursively") {
Expand Down

0 comments on commit 6cff13a

Please sign in to comment.