diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suite.scala index e67ecf858ae5d..e28d23f2ce089 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suite.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suite.scala @@ -23,7 +23,6 @@ import java.sql.{DriverManager, Statement} import java.util.concurrent.TimeoutException import scala.collection.mutable.ArrayBuffer -import scala.collection.JavaConversions._ import scala.concurrent.duration._ import scala.concurrent.{Await, Promise} import scala.sys.process.{Process, ProcessLogger} @@ -43,11 +42,6 @@ class HiveThriftServer2Suite extends FunSuite with Logging { Class.forName(classOf[HiveDriver].getCanonicalName) val verbose = Option(System.getenv("SPARK_SQL_TEST_VERBOSE")).isDefined - // Since we use info to assert server process started successfully, - // make sure that log4j level is INFO - org.apache.log4j.LogManager.getCurrentLoggers.foreach { log => - log.asInstanceOf[org.apache.log4j.Logger].setLevel(org.apache.log4j.Level.INFO) - } def startThriftServerWithin(timeout: FiniteDuration = 1.minute)(f: Statement => Unit) { Thread.sleep(5000) @@ -100,8 +94,8 @@ class HiveThriftServer2Suite extends FunSuite with Logging { .run(ProcessLogger(captureLogOutput, _ => ())) } } - - Process(command).run(ProcessLogger( + // reset SPARK_TESTING to avoid loading Log4J configurations in testing class paths + Process(command, None, ("SPARK_TESTING", "0")).run(ProcessLogger( captureThriftServerOutput("stdout"), captureThriftServerOutput("stderr")))